public class VCardCard extends VCardRecordset
Represents a single card extracted from a VCard file.
Learn more
This example shows how to use vCard property filters.
public static void run() { try (Metadata metadata = new Metadata(Constants.InputVcf)) { VCardRootPackage root = metadata.getRootPackageGeneric(); for (VCardCard vCard : root.getVCardPackage().getCards()) { // Print most preferred work phone numbers and work emails VCardCard filtered = vCard.filterWorkTags().filterPreferred(); PrintArray(filtered.getCommunicationRecordset().getTelephones()); PrintArray(filtered.getCommunicationRecordset().getEmails()); } } } private static void PrintArray(String[] values) { if (values != null) { for (String value : values) { System.out.println(value); } } }
Modifier and Type | Method and Description |
---|---|
VCardCard |
filterByGroup(String groupName)
Filters all vCard records by the group name passed as a parameter.
|
VCardCard |
filterHomeTags()
Filters all vCard records marked with the HOME tag.
|
VCardCard |
filterPreferred()
Filters the preferred records.
|
VCardCard |
filterWorkTags()
Filters all vCard records marked with the WORK tag.
|
String[] |
getAvailableGroups()
Gets the available group names.
|
VCardCalendarRecordset |
getCalendarRecordset()
Gets the calendar records.
|
VCardCommunicationRecordset |
getCommunicationRecordset()
Gets the communication records.
|
VCardDeliveryAddressingRecordset |
getDeliveryAddressingRecordset()
Gets the delivery addressing records.
|
VCardExplanatoryRecordset |
getExplanatoryRecordset()
Gets the explanatory records.
|
VCardTextRecord[] |
getExtensionRecords()
Gets the private extension records.
|
VCardGeneralRecordset |
getGeneralRecordset()
Gets the general records.
|
VCardGeographicalRecordset |
getGeographicalRecordset()
Gets the geographical records.
|
VCardIdentificationRecordset |
getIdentificationRecordset()
Gets the identification records.
|
VCardOrganizationalRecordset |
getOrganizationalRecordset()
Gets the organizational records.
|
VCardSecurityRecordset |
getSecurityRecordset()
Gets the security records.
|
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, sanitize, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final VCardGeneralRecordset getGeneralRecordset()
Gets the general records.
public final VCardIdentificationRecordset getIdentificationRecordset()
Gets the identification records.
public final VCardDeliveryAddressingRecordset getDeliveryAddressingRecordset()
Gets the delivery addressing records.
public final VCardCommunicationRecordset getCommunicationRecordset()
Gets the communication records.
public final VCardGeographicalRecordset getGeographicalRecordset()
Gets the geographical records.
public final VCardOrganizationalRecordset getOrganizationalRecordset()
Gets the organizational records.
public final VCardExplanatoryRecordset getExplanatoryRecordset()
Gets the explanatory records.
public final VCardSecurityRecordset getSecurityRecordset()
Gets the security records.
public final VCardCalendarRecordset getCalendarRecordset()
Gets the calendar records.
public final VCardTextRecord[] getExtensionRecords()
Gets the private extension records.
public final String[] getAvailableGroups()
Gets the available group names.
public final VCardCard filterByGroup(String groupName)
Filters all vCard records by the group name passed as a parameter. For more information please see the method.
groupName
- The name of the group.GetAvailableGroups
public final VCardCard filterHomeTags()
Filters all vCard records marked with the HOME tag.
public final VCardCard filterWorkTags()
Filters all vCard records marked with the WORK tag.
public final VCardCard filterPreferred()
Filters the preferred records.