Skip to content

NDefContactCreator

com.rvi.application.creator.NDefContactCreator · Class · SocialCard 1.0.3

Build a vCard record by setting only the contact fields you have.

Use firstName() or lastName() to identify the contact, then add optional details with email(), phone() and website(). Call build() after setting the fields.

final NDefContact contact = new NDefContactCreator()
.firstName("Alex")
.lastName("Example")
.email("alex@example.com")
.build();
System.out.println(contact.email());
Java imports
import com.rvi.application.creator.NDefContactCreator;
import com.rvi.domain.NDefContact;

For a smaller record, leave fields unset if they are unnecessary for the recipient.

build() calls the NDefContact constructor, which trims strings, checks basic email and phone syntax, and validates an HTTP or HTTPS website. This is input validation. It does not confirm that an address or number exists.

NDefContact · NDefMessageCreator · NDefValueException

Method signatures in the Javadoc · All API types