ezvcard.types
Class MemberType

java.lang.Object
  extended by ezvcard.types.VCardType
      extended by ezvcard.types.TextType
          extended by ezvcard.types.UriType
              extended by ezvcard.types.MemberType
All Implemented Interfaces:
Comparable<VCardType>

public class MemberType
extends UriType

The members that make up the group. This type can only be used if the KIND type is set to "group".

Adding members

 VCard vcard = new VCard();
 
 //KIND must be set to "group" in order to add MEMBERs
 vcard.setKind(KindType.group());
 
 MemberType member = new MemberType();
 member.setUriEmail("funkyjoe@hotmail.com");
 vcard.addMember(member);
 member = new MemberType();
 member.setUriIM("aol", "joesmoe@aol.com");
 vcard.addMember(member);
 member = new MemberType();
 member.setUriTelephone("+1-123-555-6789");
 vcard.addMember(member);
 member = new MemberType();
 member.setUri("urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af"); //references the UID from another vCard
 vcard.addMember(member);
 

Getting members

 VCard vcard = ...
 KindType kind = vcard.getKind();
 if (kind != null){
   if (kind.isGroup()){
     System.out.println("The group's members are:");
     for (MemberType member : vcard.getMembers()){
       System.out.println(member.getUri());
     }
   }
 }
 

vCard property name: MEMBER

vCard versions: 4.0

Author:
Michael Angstadt

Field Summary
static String NAME
           
 
Fields inherited from class ezvcard.types.TextType
value
 
Fields inherited from class ezvcard.types.VCardType
group, subTypes, typeName
 
Constructor Summary
MemberType()
           
MemberType(String uri)
           
 
Method Summary
 void addPid(int localId, int clientPidMapRef)
          Adds a PID value.
 String getAltId()
          Gets the ALTID.
 String getMediaType()
          Gets the MEDIATYPE parameter.
 List<Integer[]> getPids()
          Gets all PID parameter values.
 Integer getPref()
          Gets the preference value.
 VCardVersion[] getSupportedVersions()
          Gets the vCard versions that support this type.
 String getUri()
          Gets the URI value.
 void removePids()
          Removes all PID values.
 void setAltId(String altId)
          Sets the ALTID.
 void setMediaType(String mediaType)
          Sets the MEDIATYPE parameter.
 void setPref(Integer pref)
          Sets the preference value.
 void setUri(String uri)
          Sets the URI.
 void setUriEmail(String email)
          Sets the URI to an email address.
 void setUriIM(String protocol, String handle)
          Sets the URI to an instant messaging handle.
 void setUriTelephone(String telephone)
          Sets the URI to a telephone number.
 
Methods inherited from class ezvcard.types.UriType
doMarshalXml, doUnmarshalHtml, doUnmarshalXml
 
Methods inherited from class ezvcard.types.TextType
doMarshalText, doUnmarshalText, getValue, setValue
 
Methods inherited from class ezvcard.types.VCardType
compareTo, doMarshalSubTypes, getGroup, getQName, getSubTypes, getTypeName, marshalSubTypes, marshalText, marshalXml, setGroup, unmarshalHtml, unmarshalText, unmarshalXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

MemberType

public MemberType()

MemberType

public MemberType(String uri)
Parameters:
uri - the URI representing the member
Method Detail

getUri

public String getUri()
Gets the URI value.

Returns:
the URI value or null if no URI value is set

setUriEmail

public void setUriEmail(String email)
Sets the URI to an email address.

Parameters:
email - the email address

setUriIM

public void setUriIM(String protocol,
                     String handle)
Sets the URI to an instant messaging handle.

Parameters:
protocol - the IM protocol (e.g. "aim")
handle - the handle

setUriTelephone

public void setUriTelephone(String telephone)
Sets the URI to a telephone number.

Parameters:
telephone - the telephone number

setUri

public void setUri(String uri)
Sets the URI.

Parameters:
uri - the URI

getPids

public List<Integer[]> getPids()
Gets all PID parameter values.

vCard versions: 4.0

Returns:
the PID values or empty set if there are none
See Also:
VCardSubTypes.getPids()

addPid

public void addPid(int localId,
                   int clientPidMapRef)
Adds a PID value.

vCard versions: 4.0

Parameters:
localId - the local ID
clientPidMapRef - the ID used to reference the property's globally unique identifier in the CLIENTPIDMAP property.
See Also:
VCardSubTypes.addPid(int, int)

removePids

public void removePids()
Removes all PID values.

vCard versions: 4.0

See Also:
VCardSubTypes.removePids()

getPref

public Integer getPref()
Gets the preference value.

vCard versions: 4.0

Returns:
the preference value or null if it doesn't exist
See Also:
VCardSubTypes.getPref()

setPref

public void setPref(Integer pref)
Sets the preference value.

vCard versions: 4.0

Parameters:
pref - the preference value or null to remove
See Also:
VCardSubTypes.setPref(java.lang.Integer)

getAltId

public String getAltId()
Gets the ALTID.

vCard versions: 4.0

Returns:
the ALTID or null if it doesn't exist
See Also:
VCardSubTypes.getAltId()

setAltId

public void setAltId(String altId)
Sets the ALTID.

vCard versions: 4.0

Parameters:
altId - the ALTID or null to remove
See Also:
VCardSubTypes.setAltId(java.lang.String)

getMediaType

public String getMediaType()
Gets the MEDIATYPE parameter.

vCard versions: 4.0

Returns:
the media type or null if not set

setMediaType

public void setMediaType(String mediaType)
Sets the MEDIATYPE parameter.

vCard versions: 4.0

Parameters:
mediaType - the media type or null to remove

getSupportedVersions

public VCardVersion[] getSupportedVersions()
Description copied from class: VCardType
Gets the vCard versions that support this type.

Overrides:
getSupportedVersions in class VCardType
Returns:
the vCard versions that support this type.


Copyright © 2012-2013. All Rights Reserved.