|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.ClientPidMap
public class ClientPidMap
Maps a globally-unique URI to a PID parameter value. The PID parameter can be
set on any property where multiple instances are allowed (such as
Email
or Address
, but not StructuredName
because only
1 instance of it is allowed). It allows an individual property instance to be
uniquely identifiable.
The CLIENTPIDMAP property and the PID parameter are used during the synchronization (merging) process of two versions of the same vCard. For example, if the user has a copy of her vCard on her desktop computer and her smart phone, and she makes different modifications to each copy, then the two copies could be synchronized in order to merge all the changes into a single, new vCard.
Code sample
VCard vcard = new VCard(); Address adr = new Address(); adr.addPid(1, 1); vcard.addAddress(adr); Email email = new Email("my-email@hotmail.com"); emai.addPid(1, 1); vcard.addEmail(email); email = new Email("my-other-email@yahoo.com"); emai.addPid(2, 2); vcard.addEmail(email); //specify the URI to use ClientPidMap clientpidmap = new ClientPidMap(1, "urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af"); vcard.addClientPidMap(clientpidmap); //generate a random URI clientpidmap = ClientPidMap.random(2); vcard.addClientPidMap(clientpidmap);
Property name: CLIENTPIDMAP
Supported versions: 4.0
Field Summary |
---|
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
ClientPidMap(Integer pid,
String uri)
Creates a client PID map property. |
Method Summary | |
---|---|
Set<VCardVersion> |
_supportedVersions()
Gets the vCard versions that support this property. |
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the spec. |
Integer |
getPid()
Gets the value that is used to link the URI in this property to the property that the URI belongs to. |
String |
getUri()
Gets the URI. |
static ClientPidMap |
random(Integer pid)
Generates a CLIENTPIDMAP type that contains a random UID URI. |
void |
setPid(Integer pid)
Gets the value that is used to link the URI in this property to the property that the URI belongs to. |
void |
setUri(String uri)
Sets the URI. |
Methods inherited from class ezvcard.property.VCardProperty |
---|
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientPidMap(Integer pid, String uri)
pid
- the PIDuri
- the globally unique URIMethod Detail |
---|
public static ClientPidMap random(Integer pid)
pid
- the PID
public Set<VCardVersion> _supportedVersions()
VCardProperty
Gets the vCard versions that support this property.
This method should be overridden by child classes if the property does not support all vCard versions. The default implementation of this method returns all vCard versions.
_supportedVersions
in class VCardProperty
public Integer getPid()
VCardParameters.getPids()
public void setPid(Integer pid)
pid
- the PIDVCardParameters.getPids()
public String getUri()
public void setUri(String uri)
uri
- the URIprotected void _validate(List<Warning> warnings, VCardVersion version, VCard vcard)
VCardProperty
_validate
in class VCardProperty
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |