public class VCard extends Object implements Iterable<VCardProperty>
Constructor and Description |
---|
VCard()
Creates a new vCard set to version 3.0.
|
VCard(VCard original)
Creates a deep copy of the given vCard.
|
VCard(VCardVersion version)
Creates a new vCard.
|
Modifier and Type | Method and Description |
---|---|
void |
addAddress(Address address)
Adds a mailing address.
|
void |
addAddressAlt(Address... altRepresentations)
Adds a mailing address.
|
void |
addCalendarRequestUri(CalendarRequestUri calendarRequestUri)
Adds a URI that can be used to schedule a meeting with the person on his
or her calendar.
|
void |
addCalendarRequestUriAlt(CalendarRequestUri... altRepresentations)
Adds a URI that can be used to schedule a meeting with the person on his
or her calendar.
|
void |
addCalendarUri(CalendarUri calendarUri)
Adds a URI that points to the person's calendar.
|
void |
addCalendarUriAlt(CalendarUri... altRepresentations)
Adds a URI that points to the person's calendar.
|
void |
addCategories(Categories categories)
Adds a list of "keywords" or "tags" that can be used to describe the
person.
|
void |
addCategoriesAlt(Categories... altRepresentations)
Adds a list of "keywords" or "tags" that can be used to describe the
person.
|
void |
addClientPidMap(ClientPidMap clientPidMap)
Adds a property that is used to assign a globally-unique identifier to an
individual property instance.
|
void |
addEmail(Email email)
Adds an email address.
|
Email |
addEmail(String email,
EmailType... types)
Adds an email address.
|
void |
addEmailAlt(Email... altRepresentations)
Adds an email address.
|
void |
addExpertise(Expertise expertise)
Adds a professional subject area that the person is knowledgeable in.
|
Expertise |
addExpertise(String expertise)
Adds a professional subject area that the person is knowledgeable in.
|
void |
addExpertiseAlt(Expertise... altRepresentations)
Adds a professional subject area that the person is knowledgeable in.
|
RawProperty |
addExtendedProperty(String name,
String value)
Adds an extended property.
|
RawProperty |
addExtendedProperty(String name,
String value,
VCardDataType dataType)
Adds an extended property.
|
void |
addFbUrl(FreeBusyUrl fbUrl)
Adds a URL that can be used to determine when the person is free or busy.
|
void |
addFbUrlAlt(FreeBusyUrl... altRepresentations)
Adds a URL that can be used to determine when the person is free or busy.
|
void |
addFormattedName(FormattedName formattedName)
Adds a version of the person's full name.
|
void |
addFormattedNameAlt(FormattedName... altRepresentations)
Adds a version of the person's full name.
|
void |
addGeo(Geo geo)
Adds a geographical position of where the person lives/works.
|
void |
addGeoAlt(Geo... altRepresentations)
Adds a geographical position of where the person lives/works.
|
void |
addHobby(Hobby hobby)
Adds a hobby that the person actively engages in.
|
Hobby |
addHobby(String hobby)
Adds a hobby that the person actively engages in.
|
void |
addHobbyAlt(Hobby... altRepresentations)
Adds a hobby that the person actively engages in.
|
void |
addImpp(Impp impp)
Adds an instant messaging handle.
|
void |
addImppAlt(Impp... altRepresentations)
Adds an instant messaging handle.
|
void |
addInterest(Interest interest)
Adds an interest.
|
Interest |
addInterest(String interest)
Adds an interest.
|
void |
addInterestAlt(Interest... altRepresentations)
Adds an interest.
|
void |
addKey(Key key)
Adds a public encryption key.
|
void |
addKeyAlt(Key... altRepresentations)
Adds a public encryption key.
|
void |
addLanguage(Language language)
Adds a language that the person speaks.
|
Language |
addLanguage(String language)
Adds a language that the person speaks.
|
void |
addLanguageAlt(Language... altRepresentations)
Adds a language that the person speaks.
|
void |
addLogo(Logo logo)
Adds a logo to the vCard, such as a company logo.
|
void |
addLogoAlt(Logo... altRepresentations)
Adds a logo to the vCard, such as a company logo.
|
void |
addMember(Member member)
Adds a member to the group that this vCard represents.
|
void |
addMemberAlt(Member... altRepresentations)
Adds a member to the group that this vCard represents.
|
void |
addNickname(Nickname nickname)
Adds a set of nicknames for the person.
|
void |
addNicknameAlt(Nickname... altRepresentations)
Adds a collection of nicknames for the person.
|
void |
addNote(Note note)
Adds a note.
|
Note |
addNote(String note)
Adds a note.
|
void |
addNoteAlt(Note... altRepresentations)
Adds a note.
|
void |
addOrganization(Organization organization)
Adds a hierarchy of departments to which the person belongs.
|
void |
addOrganizationAlt(Organization... altRepresentations)
Adds a hierarchy of department(s) to which the person belongs.
|
void |
addOrgDirectory(OrgDirectory orgDirectory)
Adds an organization directory.
|
OrgDirectory |
addOrgDirectory(String orgDirectory)
Adds an organization directory.
|
void |
addOrgDirectoryAlt(OrgDirectory... altRepresentations)
Adds an organization directory.
|
void |
addOrphanedLabel(Label label)
Adds a mailing label which is not associated with an
Address
property. |
void |
addPhoto(Photo photo)
Adds a photo to the vCard, such as the person's portrait.
|
void |
addPhotoAlt(Photo... altRepresentations)
Adds a photo to the vCard, such as the person's portrait.
|
void |
addProperty(VCardProperty property)
Adds a property.
|
<T extends VCardProperty & HasAltId> |
addPropertyAlt(Class<T> propertyClass,
Collection<T> altRepresentations)
Adds a property in the form of a collection of alternative
representations.
|
<T extends VCardProperty & HasAltId> |
addPropertyAlt(Class<T> propertyClass,
T... altRepresentations)
Adds a property in the form of a collection of alternative
representations.
|
void |
addRelated(Related related)
Adds someone that the person is related to.
|
void |
addRelatedAlt(Related... altRepresentations)
Adds someone that the person is related to.
|
void |
addRole(Role role)
Adds a role associated with the person.
|
Role |
addRole(String role)
Adds a role associated with the person.
|
void |
addRoleAlt(Role... altRepresentations)
Adds a role associated with the person.
|
void |
addSound(Sound sound)
Adds a sound to the vCard, such as a pronunciation of the person's name.
|
void |
addSoundAlt(Sound... altRepresentations)
Adds a sound to the vCard, such as a pronunciation of the person's name.
|
void |
addSource(Source source)
Adds a URI that can be used to retrieve the most up-to-date version of
the person's vCard.
|
Source |
addSource(String source)
Adds a URI that can be used to retrieve the most up-to-date version of
the person's vCard.
|
void |
addSourceAlt(Source... altRepresentations)
Adds a URI that can be used to retrieve the most up-to-date version of
the person's vCard.
|
Telephone |
addTelephoneNumber(String telephoneNumber,
TelephoneType... types)
Adds a telephone number.
|
void |
addTelephoneNumber(Telephone telephoneNumber)
Adds a telephone number.
|
void |
addTelephoneNumberAlt(Telephone... altRepresentations)
Adds a telephone number.
|
void |
addTimezone(Timezone timezone)
Adds a timezone the person lives/works in.
|
void |
addTimezoneAlt(Timezone... altRepresentations)
Adds a timezone the person lives/works in.
|
Title |
addTitle(String title)
Adds a title associated with the person.
|
void |
addTitle(Title title)
Adds a title associated with the person.
|
void |
addTitleAlt(Title... altRepresentations)
Adds a title associated with the person.
|
Url |
addUrl(String url)
Adds a URL.
|
void |
addUrl(Url url)
Adds a URL.
|
void |
addUrlAlt(Url... altRepresentations)
Adds a URL.
|
void |
addXml(Xml xml)
Adds XML data to the vCard.
|
void |
addXmlAlt(Xml... altRepresentations)
Adds XML data to the vCard.
|
boolean |
equals(Object obj) |
List<Address> |
getAddresses()
Gets the mailing addresses.
|
Agent |
getAgent()
Gets information about the person's agent.
|
List<Anniversary> |
getAnniversaries()
Gets all
Anniversary property instances. |
Anniversary |
getAnniversary()
Gets the person's anniversary.
|
Birthday |
getBirthday()
Gets the person's birthday.
|
List<Birthday> |
getBirthdays()
Gets all
Birthday property instances. |
Birthplace |
getBirthplace()
Gets the person's birthplace.
|
List<Birthplace> |
getBirthplaces()
Gets all
Birthplace property instances. |
List<CalendarRequestUri> |
getCalendarRequestUris()
Gets the URIs that can be used to schedule a meeting with the person on
his or her calendar.
|
List<CalendarUri> |
getCalendarUris()
Gets the URIs that point to the person's calendar.
|
Categories |
getCategories()
Gets the list of "keywords" or "tags" that can be used to describe the
person.
|
List<Categories> |
getCategoriesList()
Gets all instances of the
Categories property. |
Classification |
getClassification()
Gets the classification of the vCard, which describes the sensitivity of
the information in the vCard.
|
List<ClientPidMap> |
getClientPidMaps()
Gets the properties that are used to assign globally-unique identifiers
to individual property instances.
|
Deathdate |
getDeathdate()
Gets the person's time of death.
|
List<Deathdate> |
getDeathdates()
Gets all
Deathdate property instances. |
Deathplace |
getDeathplace()
Gets the person's place of death.
|
List<Deathplace> |
getDeathplaces()
Gets all
Deathplace property instances. |
List<Email> |
getEmails()
Gets the email addresses.
|
List<Expertise> |
getExpertise()
Gets the professional subject areas that the person is knowledgeable in.
|
List<RawProperty> |
getExtendedProperties()
Gets all extended properties.
|
List<RawProperty> |
getExtendedProperties(String name)
Gets all extended properties with a given name.
|
RawProperty |
getExtendedProperty(String name)
Gets the first extended property with a given name.
|
List<FreeBusyUrl> |
getFbUrls()
Gets the URLs that can be used to determine when the person is free or
busy.
|
FormattedName |
getFormattedName()
Gets the person's full name.
|
List<FormattedName> |
getFormattedNames()
Gets all instances of the
FormattedName property. |
Gender |
getGender()
Gets the gender of the person.
|
Geo |
getGeo()
Gets the geographical position of where the person lives/works.
|
List<Geo> |
getGeos()
Gets all instances of the
Geo property. |
List<Hobby> |
getHobbies()
Gets the hobbies that the person actively engages in.
|
List<Impp> |
getImpps()
Gets the instant messaging handles.
|
List<Interest> |
getInterests()
Gets the person's interests.
|
List<Key> |
getKeys()
Gets the public encryption keys.
|
Kind |
getKind()
Gets the type of entity this vCard represents.
|
List<Language> |
getLanguages()
Gets the languages that the person speaks.
|
List<Logo> |
getLogos()
Gets the logos attached to the vCard, such a company logo.
|
Mailer |
getMailer()
Gets the email client that the person uses.
|
List<Member> |
getMembers()
Gets the members of the group that this vCard represents.
|
Nickname |
getNickname()
Gets the person's nicknames.
|
List<Nickname> |
getNicknames()
Gets all instances of the
Nickname property. |
List<Note> |
getNotes()
Gets the notes.
|
Organization |
getOrganization()
Gets the hierarchy of department(s) to which the person belongs.
|
List<Organization> |
getOrganizations()
Gets all instances of the
Organization property. |
List<OrgDirectory> |
getOrgDirectories()
Gets the organization directories.
|
List<Label> |
getOrphanedLabels()
Gets all mailing labels that could not be assigned to an
Address
property. |
List<Photo> |
getPhotos()
Gets the photos attached to the vCard, such as the person's portrait.
|
ProductId |
getProductId()
Gets the product ID, which identifies the software that created the
vCard.
|
Profile |
getProfile()
Gets the profile property.
|
Collection<VCardProperty> |
getProperties()
Gets all the properties in this vCard.
|
<T extends VCardProperty> |
getProperties(Class<T> clazz)
Gets all properties of a given class.
|
<T extends VCardProperty & HasAltId> |
getPropertiesAlt(Class<T> clazz)
Gets all properties of a given class, grouping the alternative
representations of each property together (see:
description of ALTID ) |
<T extends VCardProperty> |
getProperty(Class<T> clazz)
Gets the first property of a given class.
|
List<Related> |
getRelations()
Gets a list of people that the person is related to.
|
Revision |
getRevision()
Gets the time that the vCard was last modified.
|
List<Role> |
getRoles()
Gets the roles associated with the person.
|
SortString |
getSortString()
Gets the string that should be used to sort the vCard.
|
List<Sound> |
getSounds()
Gets the sounds attached to the vCard, such as a pronunciation of the
person's name.
|
SourceDisplayText |
getSourceDisplayText()
Gets a textual representation of the
Source property. |
List<Source> |
getSources()
Gets the URIs that can be used to retrieve the most up-to-date version of
the person's vCard.
|
StructuredName |
getStructuredName()
Gets the individual components of the person's name.
|
List<StructuredName> |
getStructuredNames()
Gets all structured name properties.
|
List<Telephone> |
getTelephoneNumbers()
Gets the telephone numbers.
|
Timezone |
getTimezone()
Gets the timezone the person lives/works in.
|
List<Timezone> |
getTimezones()
Gets all instances of the
Timezone property. |
List<Title> |
getTitles()
Gets the titles associated with the person.
|
Uid |
getUid()
Gets the unique identifier of the vCard.
|
List<Url> |
getUrls()
Gets the URLs.
|
VCardVersion |
getVersion()
Gets the version attached to this vCard.
|
List<Xml> |
getXmls()
Gets any XML data that is attached to the vCard.
|
int |
hashCode() |
Iterator<VCardProperty> |
iterator()
Iterates through each of the vCard's properties in no particular order.
|
List<RawProperty> |
removeExtendedProperty(String name)
Removes all extended properties that have the given name.
|
<T extends VCardProperty> |
removeProperties(Class<T> clazz)
Removes all properties of a given class.
|
boolean |
removeProperty(VCardProperty property)
Removes a property instance from the vCard.
|
void |
setAgent(Agent agent)
Sets information about the person's agent.
|
void |
setAnniversary(Anniversary anniversary)
Sets the person's anniversary.
|
Anniversary |
setAnniversary(LocalDate date)
Sets the person's anniversary.
|
void |
setAnniversaryAlt(Anniversary... altRepresentations)
Sets the person's anniversary.
|
void |
setBirthday(Birthday birthday)
Sets the person's birthday.
|
Birthday |
setBirthday(LocalDate date)
Sets the person's birthday.
|
void |
setBirthdayAlt(Birthday... altRepresentations)
Sets the person's birthday.
|
void |
setBirthplace(Birthplace birthplace)
Sets the person's birthplace.
|
void |
setBirthplaceAlt(Birthplace... altRepresentations)
Sets the person's birthplace.
|
void |
setCategories(Categories categories)
Sets the list of "keywords" or "tags" that can be used to describe the
person.
|
Categories |
setCategories(String... categories)
Sets the list of "keywords" or "tags" that can be used to describe the
person.
|
void |
setCategoriesAlt(Categories... altRepresentations)
Sets the list of "keywords" or "tags" that can be used to describe the
person.
|
void |
setClassification(Classification classification)
Sets the classification of the vCard, which describes the sensitivity of
the information in the vCard.
|
Classification |
setClassification(String classification)
Sets the classification of the vCard, which describes the sensitivity of
the information in the vCard.
|
void |
setDeathdate(Deathdate deathdate)
Sets the person's time of death.
|
Deathdate |
setDeathdate(LocalDate date)
Sets the person's time of death.
|
void |
setDeathdateAlt(Deathdate... altRepresentations)
Sets the person's time of death.
|
void |
setDeathplace(Deathplace deathplace)
Sets the person's place of death.
|
void |
setDeathplaceAlt(Deathplace... altRepresentations)
Sets the person's place of death.
|
RawProperty |
setExtendedProperty(String name,
String value)
Replaces all existing extended properties with the given name with a
single property instance.
|
RawProperty |
setExtendedProperty(String name,
String value,
VCardDataType dataType)
Replaces all existing extended properties with the given name with a
single property instance.
|
void |
setFormattedName(FormattedName formattedName)
Sets the person's full name.
|
FormattedName |
setFormattedName(String formattedName)
Sets the person's full name.
|
void |
setFormattedNameAlt(FormattedName... altRepresentations)
Sets the person's full name.
|
void |
setGender(Gender gender)
Sets the gender of the person.
|
Geo |
setGeo(double latitude,
double longitude)
Sets the geographical position of where the person lives/works.
|
void |
setGeo(Geo geo)
Sets the geographical position of where the person lives/works.
|
void |
setGeoAlt(Geo... altRepresentations)
Sets the geographical position of where the person lives/works.
|
void |
setKind(Kind kind)
Sets the type of entity this vCard represents.
|
void |
setMailer(Mailer mailer)
Sets the email client that the person uses.
|
Mailer |
setMailer(String mailer)
Sets the email client that the person uses.
|
void |
setNickname(Nickname nickname)
Sets the person's nicknames.
|
Nickname |
setNickname(String... nicknames)
Sets the person's nicknames.
|
void |
setNicknameAlt(Nickname... altRepresentations)
Sets the person's nicknames.
|
void |
setOrganization(Organization organization)
Sets the hierarchy of departments to which the person belongs.
|
Organization |
setOrganization(String... departments)
Sets the hierarchy of departments to which the person belongs.
|
void |
setOrganizationAlt(Organization... altRepresentations)
Sets the hierarchy of department(s) to which the person belongs.
|
void |
setProductId(ProductId productId)
Sets the product ID, which identifies the software that created the
vCard.
|
ProductId |
setProductId(String productId)
Sets the product ID, which identifies the software that created the
vCard.
|
void |
setProfile(Profile profile)
Sets the profile property.
|
<T extends VCardProperty> |
setProperty(Class<T> clazz,
T property)
Replaces all existing properties of the given class with a single
property instance.
|
List<VCardProperty> |
setProperty(VCardProperty property)
Replaces all existing properties of the given property instance's class
with the given property instance.
|
<T extends VCardProperty & HasAltId> |
setPropertyAlt(Class<T> propertyClass,
Collection<T> altRepresentations)
Sets a property in the form of a collection of alternative
representations.
|
<T extends VCardProperty & HasAltId> |
setPropertyAlt(Class<T> propertyClass,
T... altRepresentations)
Sets a property in the form of a collection of alternative
representations.
|
void |
setRevision(Revision revision)
Sets the time that the vCard was last modified.
|
Revision |
setRevision(Temporal rev)
Sets the time that the vCard was last modified.
|
void |
setSortString(SortString sortString)
Sets the string that should be used to sort the vCard.
|
SortString |
setSortString(String sortString)
Sets the string that should be used to sort the vCard.
|
void |
setSourceDisplayText(SourceDisplayText sourceDisplayText)
Sets a textual representation of the
Source property. |
SourceDisplayText |
setSourceDisplayText(String sourceDisplayText)
Sets a textual representation of the
Source property. |
void |
setStructuredName(StructuredName structuredName)
Sets the individual components of the person's name.
|
void |
setStructuredNameAlt(StructuredName... altRepresentations)
Sets the individual components of the person's name.
|
void |
setTimezone(Timezone timezone)
Sets the timezone the person lives/works in.
|
void |
setTimezoneAlt(Timezone... altRepresentations)
Sets the timezone the person lives/works in.
|
void |
setUid(Uid uid)
Sets the unique identifier of the vCard.
|
void |
setVersion(VCardVersion version)
Sets the version of this vCard.
|
String |
toString() |
ValidationWarnings |
validate(VCardVersion version)
Checks this vCard for data consistency problems or deviations from the
spec.
|
String |
write()
Marshals this vCard to its text representation.
|
void |
write(OutputStream out)
Marshals this vCard to its text representation.
|
void |
write(Path file)
Marshals this vCard to its text representation.
|
void |
write(Writer writer)
Marshals this vCard to its text representation.
|
String |
writeHtml()
Marshals this vCard to a basic HTML page (hCard).
|
void |
writeHtml(OutputStream out)
Marshals this vCard to a basic HTML page (hCard).
|
void |
writeHtml(Path file)
Marshals this vCard to a basic HTML page (hCard).
|
void |
writeHtml(Writer writer)
Marshals this vCard to a basic HTML page (hCard).
|
String |
writeJson()
Marshals this vCard to its JSON representation (jCard).
|
void |
writeJson(OutputStream out)
Marshals this vCard to its JSON representation (jCard).
|
void |
writeJson(Path file)
Marshals this vCard to its JSON representation (jCard).
|
void |
writeJson(Writer writer)
Marshals this vCard to its JSON representation (jCard).
|
String |
writeXml()
Marshals this vCard to its XML representation (xCard).
|
void |
writeXml(OutputStream out)
Marshals this vCard to its XML representation (xCard).
|
void |
writeXml(Path file)
Marshals this vCard to its XML representation (xCard).
|
void |
writeXml(Writer writer)
Marshals this vCard to its XML representation (xCard).
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public VCard()
public VCard(VCardVersion version)
version
- the version to assign to the vCardpublic String write()
Marshals this vCard to its text representation.
The vCard will be marshalled to whatever vCard version is assigned to
this object (see setVersion(VCardVersion)
). If no version is
set, then it will be marshalled to 3.0.
Use the VCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
VCardWriter
,
vCard 2.1,
RFC 2426 (3.0),
RFC 6350 (4.0)public void write(Path file) throws IOException
Marshals this vCard to its text representation.
The vCard will be marshalled to whatever vCard version is assigned to
this object (see setVersion(VCardVersion)
). If no version is
set, then it will be marshalled to 3.0.
Use the VCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
file
- the file to write the vCard toIOException
- if there's a problem writing to the fileVCardWriter
,
vCard 2.1,
RFC 2426 (3.0),
RFC 6350 (4.0)public void write(OutputStream out) throws IOException
Marshals this vCard to its text representation.
The vCard will be marshalled to whatever vCard version is assigned to
this object (see setVersion(VCardVersion)
). If no version is
set, then it will be marshalled to 3.0.
Use the VCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
out
- the output stream to write the vCard toIOException
- if there's a problem writing to the output streamVCardWriter
,
vCard 2.1,
RFC 2426 (3.0),
RFC 6350 (4.0)public void write(Writer writer) throws IOException
Marshals this vCard to its text representation.
The vCard will be marshalled to whatever vCard version is assigned to
this object (see setVersion(VCardVersion)
). If no version is
set, then it will be marshalled to 3.0.
Use the VCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
writer
- the writer to write the vCard toIOException
- if there's a problem writing to the writerVCardWriter
,
vCard 2.1,
RFC 2426 (3.0),
RFC 6350 (4.0)public String writeXml()
Marshals this vCard to its XML representation (xCard).
Use the XCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
XCardWriter
,
RFC 6351public void writeXml(Path file) throws IOException, TransformerException
Marshals this vCard to its XML representation (xCard).
Use the XCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
file
- the file to write toIOException
- if there's a problem writing to the fileTransformerException
- if there's a problem writing the vCardXCardWriter
,
RFC 6351public void writeXml(OutputStream out) throws TransformerException
Marshals this vCard to its XML representation (xCard).
Use the XCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
out
- the output stream to write the vCard toTransformerException
- if there's a problem writing to the output
streamXCardWriter
,
RFC 6351public void writeXml(Writer writer) throws TransformerException
Marshals this vCard to its XML representation (xCard).
Use the XCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
writer
- the writer to write the vCard toTransformerException
- if there's a problem writing to the writerXCardWriter
,
RFC 6351public String writeHtml()
Marshals this vCard to a basic HTML page (hCard).
Use the HCardPage
class for more control over the marshalling
process and to write multiple vCards to the same stream.
public void writeHtml(Path file) throws IOException
Marshals this vCard to a basic HTML page (hCard).
Use the HCardPage
class for more control over the marshalling
process and to write multiple vCards to the same stream.
file
- the file to write toIOException
- if there's a problem writing to the fileHCardPage
,
hCard 1.0public void writeHtml(OutputStream out) throws IOException
Marshals this vCard to a basic HTML page (hCard).
Use the HCardPage
class for more control over the marshalling
process and to write multiple vCards to the same stream.
out
- the output stream to write toIOException
- if there's a problem writing to the output streamHCardPage
,
hCard 1.0public void writeHtml(Writer writer) throws IOException
Marshals this vCard to a basic HTML page (hCard).
Use the HCardPage
class for more control over the marshalling
process and to write multiple vCards to the same stream.
writer
- the writer to write toIOException
- if there's a problem writing to the writerHCardPage
,
hCard 1.0public String writeJson()
Marshals this vCard to its JSON representation (jCard).
Use the JCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
JCardWriter
,
RFC 7095public void writeJson(Path file) throws IOException
Marshals this vCard to its JSON representation (jCard).
Use the JCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
file
- the file to write the vCard toIOException
- if there's a problem writing to the fileJCardWriter
,
RFC 7095public void writeJson(OutputStream out) throws IOException
Marshals this vCard to its JSON representation (jCard).
Use the JCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
out
- the output stream to write the vCard toIOException
- if there's a problem writing to the output streamJCardWriter
,
RFC 7095public void writeJson(Writer writer) throws IOException
Marshals this vCard to its JSON representation (jCard).
Use the JCardWriter
class for more control over the marshalling
process and to write multiple vCards to the same stream.
writer
- the writer to write the vCard toIOException
- if there's a problem writing to the writerJCardWriter
,
RFC 7095public VCardVersion getVersion()
public void setVersion(VCardVersion version)
Sets the version of this vCard.
When marshalling a vCard with the VCardWriter
class, use the
setTargetVersion
method to define
what version the vCard should be marshalled as. VCardWriter
does not look at the version that is set on the VCard object.
version
- the vCard versionpublic Kind getKind()
Gets the type of entity this vCard represents.
Property name: KIND
Supported versions: 4.0
public void setKind(Kind kind)
Sets the type of entity this vCard represents.
Property name: KIND
Supported versions: 4.0
kind
- the kind property or null to removepublic Gender getGender()
Gets the gender of the person.
Property name: GENDER
Supported versions: 4.0
public void setGender(Gender gender)
Sets the gender of the person.
Property name: GENDER
Supported versions: 4.0
gender
- the gender property or null to removepublic List<Member> getMembers()
Gets the members of the group that this vCard represents.
Note: If a vCard has any Member
properties, then it must also
have a Kind
property whose value is set to "group".
Property name: MEMBER
Supported versions: 4.0
VCard
object and vice versa)public void addMember(Member member)
Adds a member to the group that this vCard represents.
Note: If a vCard has any Member
properties, then it must also
have a Kind
property whose value is set to "group".
Property name: MEMBER
Supported versions: 4.0
member
- the member property to addpublic void addMemberAlt(Member... altRepresentations)
Adds a member to the group that this vCard represents.
Note: If a vCard has any Member
properties, then it must also
have a Kind
property whose value is set to "group".
Property name: MEMBER
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Profile getProfile()
Gets the profile property. This property simply identifies the vCard as a vCard.
Property name: PROFILE
Supported versions: 3.0
public void setProfile(Profile profile)
Sets the profile property. This property simply identifies the vCard as a vCard.
Property name: PROFILE
Supported versions: 3.0
profile
- the profile property or null to removepublic Classification getClassification()
Gets the classification of the vCard, which describes the sensitivity of the information in the vCard.
Property name: CLASS
Supported versions: 3.0
public void setClassification(Classification classification)
Sets the classification of the vCard, which describes the sensitivity of the information in the vCard.
Property name: CLASS
Supported versions: 3.0
classification
- the classification property or null to removepublic Classification setClassification(String classification)
Sets the classification of the vCard, which describes the sensitivity of the information in the vCard.
Supported versions: 3.0
Property name: CLASS
classification
- the classification (e.g. "PUBLIC", "PRIVATE",
"CONFIDENTIAL") or null to removepublic List<Source> getSources()
Gets the URIs that can be used to retrieve the most up-to-date version of the person's vCard.
Property name: SOURCE
Supported versions:
3.0, 4.0
VCard
object and vice versa)public void addSource(Source source)
Adds a URI that can be used to retrieve the most up-to-date version of the person's vCard.
Property name: SOURCE
Supported versions:
3.0, 4.0
source
- the source propertypublic Source addSource(String source)
Adds a URI that can be used to retrieve the most up-to-date version of the person's vCard.
Property name: SOURCE
Supported versions: 3.0, 4.0
source
- the source URI (e.g. "http://example.com/vcard.vcf")public void addSourceAlt(Source... altRepresentations)
Adds a URI that can be used to retrieve the most up-to-date version of the person's vCard.
Property name: SOURCE
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public SourceDisplayText getSourceDisplayText()
Gets a textual representation of the Source
property.
Property name: NAME
Supported versions: 3.0
public void setSourceDisplayText(SourceDisplayText sourceDisplayText)
Sets a textual representation of the Source
property.
Property name: NAME
Supported versions: 3.0
sourceDisplayText
- the property null to removepublic SourceDisplayText setSourceDisplayText(String sourceDisplayText)
Sets a textual representation of the Source
property.
Property name: NAME
Supported versions: 3.0
sourceDisplayText
- a textual representation of the vCard source or
null to removepublic List<FormattedName> getFormattedNames()
Gets all instances of the FormattedName
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see
addFormattedNameAlt
) or if
properties with different TYPE parameters are defined.
Property name: FN
Supported versions: 4.0*
* Only 4.0 supports multiple instances
VCard
object and vice versa)public FormattedName getFormattedName()
Gets the person's full name.
Property name: FN
Supported versions: 2.1, 3.0, 4.0
public void setFormattedNameAlt(FormattedName... altRepresentations)
Sets the person's full name.
Property name: FN
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addFormattedNameAlt(FormattedName... altRepresentations)
Adds a version of the person's full name.
Property name: FN
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setFormattedName(FormattedName formattedName)
Sets the person's full name.
Property name: FN
Supported versions: 2.1, 3.0, 4.0
formattedName
- the formatted name property or null to removepublic void addFormattedName(FormattedName formattedName)
Adds a version of the person's full name.
Property name: FN
Supported versions: 4.0*
* Only 4.0 supports multiple instances
formattedName
- the formatted name property to addpublic FormattedName setFormattedName(String formattedName)
Sets the person's full name.
Property name: FN
Supported versions: 2.1, 3.0, 4.0
formattedName
- the formatted name (e.g. "John Doe") or null to
removepublic List<StructuredName> getStructuredNames()
Gets all structured name properties.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see
setStructuredNameAlt
) or
if properties with different TYPE parameters are defined.
Property name: N
Supported versions: 4.0*
* Only 4.0 supports alternative representations
VCard
object and vice versa)public StructuredName getStructuredName()
Gets the individual components of the person's name.
Property name: N
Supported versions: 2.1, 3.0, 4.0
public void setStructuredNameAlt(StructuredName... altRepresentations)
Sets the individual components of the person's name.
Property name: N
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setStructuredName(StructuredName structuredName)
Property name: N
Supported versions: 2.1, 3.0, 4.0
structuredName
- the structured name property or null to removepublic List<Nickname> getNicknames()
Gets all instances of the Nickname
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see setNicknameAlt
) or if properties with different TYPE parameters are
defined.
Property name: NICKNAME
Supported versions: 3.0, 4.0
VCard
object and vice versa)public Nickname getNickname()
Gets the person's nicknames.
Property name: NICKNAME
Supported versions: 3.0, 4.0
public void setNicknameAlt(Nickname... altRepresentations)
Sets the person's nicknames.
Property name: NICKNAME
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addNicknameAlt(Nickname... altRepresentations)
Adds a collection of nicknames for the person.
Property name: NICKNAME
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setNickname(Nickname nickname)
Sets the person's nicknames.
Property name: NICKNAME
Supported versions: 3.0, 4.0
nickname
- the nickname property (may contain multiple values) or
null to removepublic void addNickname(Nickname nickname)
Adds a set of nicknames for the person.
Note that only version 4.0 vCards support multiple instances of this property.
Property name: NICKNAME
Supported versions: 4.0*
* Only 4.0 supports multiple instances
nickname
- the nickname property (may contain multiple values)public Nickname setNickname(String... nicknames)
Sets the person's nicknames.
Property name: NICKNAME
Supported versions: 3.0, 4.0
nicknames
- the nicknames (e.g. "John", "Jon")public SortString getSortString()
Gets the string that should be used to sort the vCard. This typically set to the person's family name (last name).
For 4.0 vCards, this information is stored in the
StructuredName.getSortAs()
and/or Organization.getSortAs()
methods.
Property name: SORT-STRING
Supported versions: 3.0
public void setSortString(SortString sortString)
Sets the string that should be used to sort the vCard. This typically set to the person's family name (last name).
For 4.0 vCards, this information is stored in the
StructuredName.getSortAs()
and/or Organization.getSortAs()
methods.
Property name: SORT-STRING
Supported versions: 3.0
sortString
- the sort string property or null to removepublic SortString setSortString(String sortString)
Sets the string that should be used to sort the vCard. This typically set to the person's family name (last name).
For 4.0 vCards, this information is stored in the
StructuredName.getSortAs()
and/or Organization.getSortAs()
methods.
Property name: SORT-STRING
Supported versions: 3.0
sortString
- the sort string (e.g. "Armour" if the person's last
name is "d'Armour") or null to removepublic List<Title> getTitles()
Gets the titles associated with the person.
Property name: TITLE
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addTitle(Title title)
Adds a title associated with the person.
Property name: TITLE
Supported versions: 2.1, 3.0, 4.0
title
- the title property to addpublic Title addTitle(String title)
Adds a title associated with the person.
Property name: TITLE
Supported versions: 2.1, 3.0, 4.0
title
- the title to add (e.g. "V.P. Research and Development")public void addTitleAlt(Title... altRepresentations)
Adds a title associated with the person.
Property name: TITLE
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Role> getRoles()
Gets the roles associated with the person.
Property name: ROLE
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addRole(Role role)
Adds a role associated with the person.
Property name: ROLE
Supported versions: 2.1, 3.0, 4.0
role
- the role property to addpublic Role addRole(String role)
Adds a role associated with the person.
Property name: ROLE
Supported versions: 2.1, 3.0, 4.0
role
- the role to add (e.g. "Executive")public void addRoleAlt(Role... altRepresentations)
Adds a role associated with the person.
Property name: ROLE
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Photo> getPhotos()
Gets the photos attached to the vCard, such as the person's portrait.
Property name: PHOTO
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addPhoto(Photo photo)
Adds a photo to the vCard, such as the person's portrait.
Property name: PHOTO
Supported versions: 2.1, 3.0, 4.0
photo
- the photo property to addpublic void addPhotoAlt(Photo... altRepresentations)
Adds a photo to the vCard, such as the person's portrait.
Property name: PHOTO
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Logo> getLogos()
Gets the logos attached to the vCard, such a company logo.
Property name: LOGO
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addLogo(Logo logo)
Adds a logo to the vCard, such as a company logo.
Property name: LOGO
Supported versions: 2.1, 3.0, 4.0
logo
- the logo property to addpublic void addLogoAlt(Logo... altRepresentations)
Adds a logo to the vCard, such as a company logo.
Property name: LOGO
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Sound> getSounds()
Gets the sounds attached to the vCard, such as a pronunciation of the person's name.
Property name: SOUND
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addSound(Sound sound)
Adds a sound to the vCard, such as a pronunciation of the person's name.
Property name: SOUND
Supported versions: 2.1, 3.0, 4.0
sound
- the sound property to addpublic void addSoundAlt(Sound... altRepresentations)
Adds a sound to the vCard, such as a pronunciation of the person's name.
Property name: SOUND
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Birthplace> getBirthplaces()
Gets all Birthplace
property instances.
There may be multiple instances if alternative representations are
defined (see setBirthplaceAlt
).
Property name: BIRTHPLACE
Supported versions: 4.0
VCard
object and vice versa)public Birthplace getBirthplace()
Gets the person's birthplace.
Property name: BIRTHPLACE
Supported versions: 4.0
public void setBirthplaceAlt(Birthplace... altRepresentations)
Sets the person's birthplace.
Property name: BIRTHPLACE
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setBirthplace(Birthplace birthplace)
Sets the person's birthplace.
Property name: BIRTHPLACE
Supported versions: 4.0
birthplace
- the birthplace property or null to removepublic List<Deathplace> getDeathplaces()
Gets all Deathplace
property instances.
There may be multiple instances if alternative representations are
defined (see setDeathplaceAlt
).
Property name: DEATHPLACE
Supported versions: 4.0
VCard
object and vice versa)public Deathplace getDeathplace()
Gets the person's place of death.
Property name: DEATHPLACE
Supported versions: 4.0
public void setDeathplaceAlt(Deathplace... altRepresentations)
Sets the person's place of death.
Property name: DEATHPLACE
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setDeathplace(Deathplace deathplace)
Sets the person's place of death.
Property name: DEATHPLACE
Supported versions: 4.0
deathplace
- the deathplace property or null to removepublic List<Deathdate> getDeathdates()
Gets all Deathdate
property instances.
There may be multiple instances if alternative representations are
defined (see setDeathdateAlt
).
Property name: DEATHDATE
Supported versions: 4.0
VCard
object and vice versa)public Deathdate getDeathdate()
Gets the person's time of death.
Property name: DEATHDATE
Supported versions: 4.0
public void setDeathdateAlt(Deathdate... altRepresentations)
Sets the person's time of death.
Property name: DEATHDATE
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Deathdate setDeathdate(LocalDate date)
Sets the person's time of death.
Property name: DEATHDATE
Supported versions: 4.0
date
- the death date or null to removepublic void setDeathdate(Deathdate deathdate)
Sets the person's time of death.
Property name: DEATHDATE
Supported versions: 4.0
deathdate
- the death date property or null to removepublic List<Birthday> getBirthdays()
Gets all Birthday
property instances.
There may be multiple instances if alternative representations are
defined (see setBirthdayAlt
).
Property name: BDAY
Supported versions: 4.0*
* Only 4.0 supports alternative representations
VCard
object and vice versa)public Birthday getBirthday()
Gets the person's birthday.
Property name: BDAY
Supported versions: 2.1, 3.0, 4.0
public void setBirthdayAlt(Birthday... altRepresentations)
Sets the person's birthday.
Property name: BDAY
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Birthday setBirthday(LocalDate date)
Sets the person's birthday.
Property name: BDAY
Supported versions: 2.1, 3.0, 4.0
date
- the birthday or null to removepublic void setBirthday(Birthday birthday)
Sets the person's birthday.
Property name: BDAY
Supported versions: 2.1, 3.0, 4.0
birthday
- the birthday or null to removepublic List<Anniversary> getAnniversaries()
Gets all Anniversary
property instances.
There may be multiple instances if alternative representations are
defined (see setAnniversaryAlt
).
Property name: ANNIVERSARY
Supported versions: 4.0
VCard
object and vice versa)public Anniversary getAnniversary()
Gets the person's anniversary.
Property name: ANNIVERSARY
Supported versions: 4.0
public void setAnniversaryAlt(Anniversary... altRepresentations)
Sets the person's anniversary.
Property name: ANNIVERSARY
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Anniversary setAnniversary(LocalDate date)
Sets the person's anniversary.
Property name: ANNIVERSARY
Supported versions: 4.0
date
- the date of the anniversary or null to removepublic void setAnniversary(Anniversary anniversary)
Sets the person's anniversary.
Property name: ANNIVERSARY
Supported versions: 4.0
anniversary
- the anniversary property or null to removepublic Revision getRevision()
Property name: REV
Supported versions: 2.1, 3.0, 4.0
public void setRevision(Revision revision)
Sets the time that the vCard was last modified.
Property name: REV
Supported versions: 2.1, 3.0, 4.0
revision
- the revision property or null to removepublic Revision setRevision(Temporal rev)
Sets the time that the vCard was last modified.
Property name: REV
Supported versions: 2.1, 3.0, 4.0
rev
- the last modified time (Instant
recommended) or null
to removepublic ProductId getProductId()
Gets the product ID, which identifies the software that created the vCard.
Property name: PRODID
Supported versions: 3.0, 4.0
public void setProductId(ProductId productId)
Sets the product ID, which identifies the software that created the vCard.
Property name: PRODID
Supported versions: 3.0, 4.0
productId
- the product ID property or null to removepublic ProductId setProductId(String productId)
Sets the product ID, which identifies the software that created the vCard.
Property name: PRODID
Supported versions: 3.0, 4.0
productId
- the product ID (e.g. "ez-vcard 1.0") or null to removepublic List<Address> getAddresses()
Gets the mailing addresses.
Property name: ADR
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addAddress(Address address)
Adds a mailing address.
Property name: ADR
Supported versions: 2.1, 3.0, 4.0
address
- the mailing address property to addpublic void addAddressAlt(Address... altRepresentations)
Adds a mailing address.
Property name: ADR
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Label> getOrphanedLabels()
Gets all mailing labels that could not be assigned to an Address
property. Use Address.getLabel()
to get a label that has been
assigned to an address.
Property name: LABEL
Supported versions: 2.1, 3.0
VCard
object and vice versa)public void addOrphanedLabel(Label label)
Adds a mailing label which is not associated with an Address
property.
Use of this method is strongly discouraged. To add a mailing label to an
address, use the Address.setLabel(java.lang.String)
method.
Property name: LABEL
Supported versions: 2.1, 3.0
label
- the orphaned label property to addpublic List<Email> getEmails()
Gets the email addresses.
Property name: EMAIL
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addEmail(Email email)
Adds an email address.
Property name: EMAIL
Supported versions: 2.1, 3.0, 4.0
email
- the email address property to addpublic Email addEmail(String email, EmailType... types)
Adds an email address.
Property name: EMAIL
Supported versions: 2.1, 3.0, 4.0
email
- the email address to add (e.g. "johndoe@aol.com")types
- the type(s) to assign to the emailpublic void addEmailAlt(Email... altRepresentations)
Adds an email address.
Property name: EMAIL
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Telephone> getTelephoneNumbers()
Gets the telephone numbers.
Property name: TEL
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addTelephoneNumber(Telephone telephoneNumber)
Adds a telephone number.
Property name: TEL
Supported versions: 2.1, 3.0, 4.0
telephoneNumber
- the telephone number property to addpublic Telephone addTelephoneNumber(String telephoneNumber, TelephoneType... types)
Adds a telephone number.
Property name: TEL
Supported versions: 2.1, 3.0, 4.0
telephoneNumber
- the telephone number to add (e.g. "+1
555-555-5555")types
- the type(s) to assign to the telephone number (e.g. "cell",
"work", etc)public void addTelephoneNumberAlt(Telephone... altRepresentations)
Adds a telephone number.
Property name: TEL
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Mailer getMailer()
Gets the email client that the person uses.
Property name: MAILER
Supported versions: 2.1, 3.0
public void setMailer(Mailer mailer)
Sets the email client that the person uses.
Property name: MAILER
Supported versions: 2.1, 3.0
mailer
- the mailer property or null to removepublic Mailer setMailer(String mailer)
Sets the email client that the person uses.
Property name: MAILER
Supported versions: 2.1, 3.0
mailer
- the email client (e.g. "Thunderbird") or null to removepublic List<Url> getUrls()
Gets the URLs. URLs can point to websites such as a personal homepage or business website.
Property name: URL
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addUrl(Url url)
Adds a URL. URLs can point to websites such as a personal homepage or business website.
Property name: URL
Supported versions: 2.1, 3.0, 4.0
url
- the URL property to addpublic Url addUrl(String url)
Adds a URL. URLs can point to websites such as a personal homepage or business website.
Property name: URL
Supported versions: 2.1, 3.0, 4.0
url
- the URL to add (e.g. "http://example.com")public void addUrlAlt(Url... altRepresentations)
Adds a URL. URLs can point to websites such as a personal homepage or business website.
Property name: URL
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Timezone> getTimezones()
Gets all instances of the Timezone
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see setTimezoneAlt
) or if properties with different TYPE parameters are
defined.
Property name: TZ
Supported versions: 4.0*
* Only 4.0 supports multiple instances
VCard
object and vice versa)public Timezone getTimezone()
Gets the timezone the person lives/works in.
Property name: TZ
Supported versions: 2.1, 3.0, 4.0
public void setTimezoneAlt(Timezone... altRepresentations)
Sets the timezone the person lives/works in.
Property name: TZ
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addTimezoneAlt(Timezone... altRepresentations)
Adds a timezone the person lives/works in.
Property name: TZ
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setTimezone(Timezone timezone)
Sets the timezone the person lives/works in.
Property name: TZ
Supported versions: 2.1, 3.0, 4.0
timezone
- the timezone property or null to removepublic void addTimezone(Timezone timezone)
Adds a timezone the person lives/works in.
Property name: TZ
Supported versions: 4.0*
* Only 4.0 supports multiple instances
timezone
- the timezone property to addpublic List<Geo> getGeos()
Gets all instances of the Geo
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see setGeoAlt
) or
if properties with different TYPE parameters are defined.
Property name: GEO
Supported versions: 4.0*
* Only 4.0 supports multiple instances
VCard
object and vice versa)public Geo getGeo()
Gets the geographical position of where the person lives/works.
Property name: GEO
Supported versions: 2.1, 3.0, 4.0
public void setGeoAlt(Geo... altRepresentations)
Sets the geographical position of where the person lives/works.
Property name: GEO
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addGeoAlt(Geo... altRepresentations)
Adds a geographical position of where the person lives/works.
Property name: GEO
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setGeo(Geo geo)
Sets the geographical position of where the person lives/works.
Property name: GEO
Supported versions: 2.1, 3.0, 4.0
geo
- the geo property or null to removepublic void addGeo(Geo geo)
Adds a geographical position of where the person lives/works. Note that only version 4.0 vCards support multiple instances of this property.
Property name: GEO
Supported versions: 4.0*
* Only 4.0 supports multiple instances
geo
- the geo property to addpublic Geo setGeo(double latitude, double longitude)
Sets the geographical position of where the person lives/works.
Property name: GEO
Supported versions: 2.1, 3.0, 4.0
latitude
- the latitudelongitude
- the longitudepublic List<Organization> getOrganizations()
Gets all instances of the Organization
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see
setOrganizationAlt
) or if
properties with different TYPE parameters are defined.
Property name: ORG
Supported versions: 4.0*
* Only 4.0 supports multiple instances
VCard
object and vice versa)public Organization getOrganization()
Gets the hierarchy of department(s) to which the person belongs.
Property name: ORG
Supported versions: 2.1, 3.0, 4.0
public void setOrganizationAlt(Organization... altRepresentations)
Sets the hierarchy of department(s) to which the person belongs.
Property name: ORG
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addOrganizationAlt(Organization... altRepresentations)
Adds a hierarchy of department(s) to which the person belongs.
Property name: ORG
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setOrganization(Organization organization)
Sets the hierarchy of departments to which the person belongs.
Property name: ORG
Supported versions: 2.1, 3.0, 4.0
organization
- the organization property or null to removepublic void addOrganization(Organization organization)
Adds a hierarchy of departments to which the person belongs. Note that only version 4.0 vCards support multiple instances of this property.
Property name: ORG
Supported versions: 4.0*
* Only 4.0 supports multiple instances
organization
- the organization property to addpublic Organization setOrganization(String... departments)
Sets the hierarchy of departments to which the person belongs.
Property name: ORG
Supported versions: 2.1, 3.0, 4.0
departments
- the ordered list of department(s), starting with the
broadest and ending with the most specific (e.g. "Google", "Gmail Team",
"Spam Detection Squad") or an empty arguments list to removepublic List<Categories> getCategoriesList()
Gets all instances of the Categories
property.
Version 4.0 vCards may have multiple instances if alternative
representations are defined (see setCategoriesAlt
) or if properties with different TYPE parameters are
defined.
Property name: CATEGORIES
Supported versions: 4.0*
* Only 4.0 supports multiple instances
VCard
object and vice versa)public Categories getCategories()
Gets the list of "keywords" or "tags" that can be used to describe the person.
Property name: CATEGORIES
Supported versions: 3.0, 4.0
public void setCategoriesAlt(Categories... altRepresentations)
Sets the list of "keywords" or "tags" that can be used to describe the person.
Property name: CATEGORIES
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void addCategoriesAlt(Categories... altRepresentations)
Adds a list of "keywords" or "tags" that can be used to describe the person.
Property name: CATEGORIES
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public void setCategories(Categories categories)
Sets the list of "keywords" or "tags" that can be used to describe the person.
Property name: CATEGORIES
Supported versions: 3.0, 4.0
categories
- the categories property (can contain multiple values)
or null to removepublic void addCategories(Categories categories)
Adds a list of "keywords" or "tags" that can be used to describe the person. Note that only version 4.0 vCards support multiple instances of this property.
Property name: CATEGORIES
Supported versions: 4.0*
* Only 4.0 supports multiple instances
categories
- the categories property to add (can contain multiple
values)public Categories setCategories(String... categories)
Sets the list of "keywords" or "tags" that can be used to describe the person.
Property name: CATEGORIES
Supported versions: 3.0, 4.0
categories
- the categories (e.g. "swimmer", "biker", "knitter") or
an empty arguments list to removepublic Agent getAgent()
Gets information about the person's agent.
Property name: AGENT
Supported versions: 2.1, 3.0
public void setAgent(Agent agent)
Sets information about the person's agent.
Property name: AGENT
Supported versions: 2.1, 3.0
agent
- the agent property or null to removepublic List<Note> getNotes()
Gets the notes. Notes contain free-form, miscellaneous text.
Property name: NOTE
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addNote(Note note)
Adds a note. Notes contain free-form, miscellaneous text.
Property name: NOTE
Supported versions: 2.1, 3.0, 4.0
note
- the note property to addpublic Note addNote(String note)
Adds a note. Notes contain free-form, miscellaneous text.
Property name: NOTE
Supported versions: 2.1, 3.0, 4.0
note
- the note to addpublic void addNoteAlt(Note... altRepresentations)
Adds a note. Notes contain free-form, miscellaneous text.
Property name: NOTE
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Uid getUid()
Gets the unique identifier of the vCard.
Property name: UID
Supported versions: 2.1, 3.0, 4.0
public void setUid(Uid uid)
Sets the unique identifier of the vCard.
Property name: UID
Supported versions: 2.1, 3.0, 4.0
uid
- the unique identifier property or null to removepublic List<Key> getKeys()
Gets the public encryption keys.
Property name: KEY
Supported versions: 2.1, 3.0, 4.0
VCard
object and vice versa)public void addKey(Key key)
Adds a public encryption key.
Property name: KEY
Supported versions: 2.1, 3.0, 4.0
key
- the key property to addpublic void addKeyAlt(Key... altRepresentations)
Adds a public encryption key.
Property name: KEY
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Impp> getImpps()
Gets the instant messaging handles.
Property name: IMPP
Supported versions: 3.0, 4.0
VCard
object and vice versa)public void addImpp(Impp impp)
Adds an instant messaging handle.
Property name: IMPP
Supported versions: 3.0, 4.0
impp
- the IMPP property to addpublic void addImppAlt(Impp... altRepresentations)
Adds an instant messaging handle.
Property name: IMPP
Supported versions: 4.0*
* Only 4.0 supports alternative representations
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Related> getRelations()
Gets a list of people that the person is related to.
Property name: RELATED
Supported versions: 4.0
VCard
object and vice versa)public void addRelated(Related related)
Adds someone that the person is related to.
Property name: RELATED
Supported versions: 4.0
related
- the relation property to addpublic void addRelatedAlt(Related... altRepresentations)
Adds someone that the person is related to.
Property name: RELATED
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Language> getLanguages()
Gets the languages that the person speaks.
Property name: LANG
Supported versions: 4.0
VCard
object and vice versa)public void addLanguage(Language language)
Adds a language that the person speaks.
Property name: LANG
Supported versions: 4.0
language
- the language property to addpublic Language addLanguage(String language)
Adds a language that the person speaks.
Property name: LANG
Supported versions: 4.0
language
- the language to add (e.g. "en-us")public void addLanguageAlt(Language... altRepresentations)
Adds a language that the person speaks.
Property name: LANG
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<CalendarRequestUri> getCalendarRequestUris()
Gets the URIs that can be used to schedule a meeting with the person on his or her calendar.
Property name: CALADRURI
Supported versions: 4.0
VCard
object and vice versa)public void addCalendarRequestUri(CalendarRequestUri calendarRequestUri)
Adds a URI that can be used to schedule a meeting with the person on his or her calendar.
Property name: CALADRURI
Supported versions: 4.0
calendarRequestUri
- the calendar request URI property to addpublic void addCalendarRequestUriAlt(CalendarRequestUri... altRepresentations)
Adds a URI that can be used to schedule a meeting with the person on his or her calendar.
Property name: CALADRURI
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<CalendarUri> getCalendarUris()
Gets the URIs that point to the person's calendar.
Property name: CALURI
Supported versions: 4.0
VCard
object and vice versa)public void addCalendarUri(CalendarUri calendarUri)
Adds a URI that points to the person's calendar.
Property name: CALURI
Supported versions: 4.0
calendarUri
- the calendar URI property to addpublic void addCalendarUriAlt(CalendarUri... altRepresentations)
Adds a URI that points to the person's calendar.
Property name: CALURI
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<FreeBusyUrl> getFbUrls()
Gets the URLs that can be used to determine when the person is free or busy.
Property name: FBURL
Supported versions: 4.0
VCard
object and vice versa)public void addFbUrl(FreeBusyUrl fbUrl)
Adds a URL that can be used to determine when the person is free or busy.
Property name: FBURL
Supported versions: 4.0
fbUrl
- the free-busy URL property to addpublic void addFbUrlAlt(FreeBusyUrl... altRepresentations)
Adds a URL that can be used to determine when the person is free or busy.
Property name: FBURL
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<ClientPidMap> getClientPidMaps()
Gets the properties that are used to assign globally-unique identifiers to individual property instances. They are used for merging together different versions of the same vCard.
Property name: CLIENTPIDMAP
Supported versions: 4.0
VCard
object and vice versa)public void addClientPidMap(ClientPidMap clientPidMap)
Adds a property that is used to assign a globally-unique identifier to an individual property instance. They are used for merging together different versions of the same vCard.
Property name: CLIENTPIDMAP
Supported versions: 4.0
clientPidMap
- the client PID map property to addpublic List<Xml> getXmls()
Gets any XML data that is attached to the vCard.
These properties may be present if the vCard was encoded in XML ("xCard" format) and the XML document contained non-standard elements. In this case, the properties would contain all of the non-standard XML elements.
Property name: XML
Supported versions: 4.0
VCard
object and vice versa)public void addXml(Xml xml)
Adds XML data to the vCard.
These properties may be present if the vCard was encoded in XML ("xCard" format) and the XML document contained non-standard elements. In this case, the properties would contain all of the non-standard XML elements.
Property name: XML
Supported versions: 4.0
xml
- the XML property to addpublic void addXmlAlt(Xml... altRepresentations)
Adds XML data to the vCard.
These properties may be present if the vCard was encoded in XML ("xCard" format) and the XML document contained non-standard elements. In this case, the properties would contain all of the non-standard XML elements.
Property name: XML
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Expertise> getExpertise()
Gets the professional subject areas that the person is knowledgeable in.
Property name: EXPERTISE
Supported versions: 4.0
VCard
object and vice versa)public void addExpertise(Expertise expertise)
Adds a professional subject area that the person is knowledgeable in.
Property name: EXPERTISE
Supported versions: 4.0
expertise
- the expertise property to addpublic Expertise addExpertise(String expertise)
Adds a professional subject area that the person is knowledgeable in.
Property name: EXPERTISE
Supported versions: 4.0
expertise
- the professional subject area to add (e.g.
"programming")public void addExpertiseAlt(Expertise... altRepresentations)
Adds a professional subject area that the person is knowledgeable in.
Property name: EXPERTISE
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Hobby> getHobbies()
Gets the hobbies that the person actively engages in.
Property name: HOBBY
Supported versions: 4.0
VCard
object and vice versa)public void addHobby(Hobby hobby)
Adds a hobby that the person actively engages in.
Property name: HOBBY
Supported versions: 4.0
hobby
- the hobby property to addpublic Hobby addHobby(String hobby)
Adds a hobby that the person actively engages in.
Property name: HOBBY
Supported versions: 4.0
hobby
- the hobby to add (e.g. "photography")public void addHobbyAlt(Hobby... altRepresentations)
Adds a hobby that the person actively engages in.
Property name: HOBBY
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<Interest> getInterests()
Gets the person's interests.
Property name: INTEREST
Supported versions: 4.0
VCard
object and vice versa)public void addInterest(Interest interest)
Adds an interest.
Property name: INTEREST
Supported versions: 4.0
interest
- the interest property to addpublic Interest addInterest(String interest)
Adds an interest.
Property name: INTEREST
Supported versions: 4.0
interest
- the interest to add (e.g. "football")public void addInterestAlt(Interest... altRepresentations)
Adds an interest.
Property name: INTEREST
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public List<OrgDirectory> getOrgDirectories()
Gets the organization directories.
Property name: ORG-DIRECTORY
Supported versions: 4.0
VCard
object and vice versa)public void addOrgDirectory(OrgDirectory orgDirectory)
Adds an organization directory.
Property name: ORG-DIRECTORY
Supported versions: 4.0
orgDirectory
- the organization directory property to addpublic OrgDirectory addOrgDirectory(String orgDirectory)
Adds an organization directory.
Property name: ORG-DIRECTORY
Supported versions: 4.0
orgDirectory
- the organization directory to add (e.g.
"http://company.com/staff")public void addOrgDirectoryAlt(OrgDirectory... altRepresentations)
Adds an organization directory.
Property name: ORG-DIRECTORY
Supported versions: 4.0
altRepresentations
- the alternative representations of the same
value. These properties contain the same information, but in different
forms (such as different languages). See this description of the ALTID parameter
for more information. Note that
this method automatically assigns an appropriate ALTID parameter to each
property.public Iterator<VCardProperty> iterator()
iterator
in interface Iterable<VCardProperty>
public <T extends VCardProperty> T getProperty(Class<T> clazz)
T
- the property classclazz
- the property classpublic <T extends VCardProperty> List<T> getProperties(Class<T> clazz)
T
- the property classclazz
- the property classVCard
object and vice versa)public <T extends VCardProperty & HasAltId> List<List<T>> getPropertiesAlt(Class<T> clazz)
description of ALTID
)T
- the property classclazz
- the property classpublic Collection<VCardProperty> getProperties()
public void addProperty(VCardProperty property)
property
- the property to addpublic List<VCardProperty> setProperty(VCardProperty property)
property
- the propertypublic <T extends VCardProperty> List<T> setProperty(Class<T> clazz, T property)
T
- the property classclazz
- the property class (e.g. "Note.class")property
- the property or null to removepublic boolean removeProperty(VCardProperty property)
property
- the property to removepublic <T extends VCardProperty> List<T> removeProperties(Class<T> clazz)
T
- the property classclazz
- the class of the properties to remove (e.g. "Note.class")public RawProperty getExtendedProperty(String name)
name
- the property name (e.g. "X-ALT-DESC")public List<RawProperty> getExtendedProperties(String name)
name
- the property name (e.g. "X-ALT-DESC")public List<RawProperty> getExtendedProperties()
VCard
object and vice versa)public RawProperty addExtendedProperty(String name, String value)
name
- the property name (e.g. "X-ALT-DESC")value
- the property valuepublic RawProperty addExtendedProperty(String name, String value, VCardDataType dataType)
name
- the property name (e.g. "X-ALT-DESC")value
- the property valuedataType
- the property value's data typepublic RawProperty setExtendedProperty(String name, String value)
name
- the property name (e.g. "X-ALT-DESC")value
- the property valuepublic RawProperty setExtendedProperty(String name, String value, VCardDataType dataType)
name
- the property name (e.g. "X-ALT-DESC")value
- the property valuedataType
- the property value's data typepublic List<RawProperty> removeExtendedProperty(String name)
name
- the component name (e.g. "X-ALT-DESC")public <T extends VCardProperty & HasAltId> void addPropertyAlt(Class<T> propertyClass, T... altRepresentations)
description of ALTID
).T
- the property classpropertyClass
- the property classaltRepresentations
- the alternative representations of the property
to addpublic <T extends VCardProperty & HasAltId> void addPropertyAlt(Class<T> propertyClass, Collection<T> altRepresentations)
description of ALTID
).T
- the property classpropertyClass
- the property classaltRepresentations
- the alternative representations of the property
to addpublic <T extends VCardProperty & HasAltId> List<T> setPropertyAlt(Class<T> propertyClass, T... altRepresentations)
description of ALTID
).T
- the property classpropertyClass
- the property classaltRepresentations
- the alternative representations of the property
to addpublic <T extends VCardProperty & HasAltId> List<T> setPropertyAlt(Class<T> propertyClass, Collection<T> altRepresentations)
description of ALTID
).T
- the property classpropertyClass
- the property classaltRepresentations
- the alternative representations of the property
to addpublic ValidationWarnings validate(VCardVersion version)
version
- the version to check the vCard against (use
VCardVersion.V4_0
for xCard and jCard)Copyright © 2012–2023 Michael Angstadt. All rights reserved.