ezvcard.property
Class StructuredName

java.lang.Object
  extended by ezvcard.property.VCardProperty
      extended by ezvcard.property.StructuredName
All Implemented Interfaces:
HasAltId, Comparable<VCardProperty>

public class StructuredName
extends VCardProperty
implements HasAltId

Contains the separated components of the person's name.

Code sample

 VCard vcard = new VCard();
 StructuredName n = new StructuredName();
 n.setFamily("House");
 n.setGiven("Gregory");
 n.addPrefix("Dr");
 n.addSuffix("MD");
 vcard.setStructuredName(n);
 

Property name: N

Supported versions: 2.1, 3.0, 4.0

Author:
Michael Angstadt

Field Summary
 
Fields inherited from class ezvcard.property.VCardProperty
group, parameters
 
Constructor Summary
StructuredName()
           
 
Method Summary
 void addAdditional(String additional)
          Adds an additional name the person goes by.
 void addPrefix(String prefix)
          Adds a prefix.
 void addSuffix(String suffix)
          Adds a suffix.
 List<String> getAdditional()
          Gets any additional names the person goes by.
 String getAltId()
          Gets the property's ALTID parameter.
 String getFamily()
          Gets the family name (aka "last name").
 String getGiven()
          Gets the given name (aka "first name").
 String getLanguage()
          Gets the language that the property value is written in.
 List<String> getPrefixes()
          Gets the prefixes.
 List<String> getSortAs()
          Gets the string(s) that define how to sort the vCard.
 List<String> getSuffixes()
          Gets the suffixes.
 void setAltId(String altId)
          Sets the property's ALTID parameter.
 void setFamily(String family)
          Sets the family name (aka "last name").
 void setGiven(String given)
          Sets the given name (aka "first name").
 void setLanguage(String language)
          Sets the language that the property value is written in.
 void setSortAs(String family)
          Sets the string that defines how to sort the vCard.
 void setSortAs(String family, String given)
          Sets the strings that define how to sort the vCard.
 
Methods inherited from class ezvcard.property.VCardProperty
_supportedVersions, _validate, 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

StructuredName

public StructuredName()
Method Detail

getFamily

public String getFamily()
Gets the family name (aka "last name").

Returns:
the family name or null if not set

setFamily

public void setFamily(String family)
Sets the family name (aka "last name").

Parameters:
family - the family name or null to remove

getGiven

public String getGiven()
Gets the given name (aka "first name").

Returns:
the given name or null if not set

setGiven

public void setGiven(String given)
Sets the given name (aka "first name").

Parameters:
given - the given name or null to remove

getAdditional

public List<String> getAdditional()
Gets any additional names the person goes by.

Returns:
the additional names or empty list if there are none

addAdditional

public void addAdditional(String additional)
Adds an additional name the person goes by.

Parameters:
additional - the additional name to add

getPrefixes

public List<String> getPrefixes()
Gets the prefixes.

Returns:
the prefixes (e.g. "Mr.") or empty list if there are none

addPrefix

public void addPrefix(String prefix)
Adds a prefix.

Parameters:
prefix - the prefix to add (e.g. "Mr.")

getSuffixes

public List<String> getSuffixes()
Gets the suffixes.

Returns:
the suffixes (e.g. "Jr.") or empty list if there are none

addSuffix

public void addSuffix(String suffix)
Adds a suffix.

Parameters:
suffix - the suffix to add (e.g. "Jr.")

getSortAs

public List<String> getSortAs()
Gets the string(s) that define how to sort the vCard.

2.1 and 3.0 vCards should use the SORT-STRING property instead.

Supported versions: 4.0

Returns:
the sort string(s) (e.g. ["Aboville", "Christine"] if the family name is "d'Aboville" and the given name is "Christine") or empty list if there are none
See Also:
VCardParameters.getSortAs()

setSortAs

public void setSortAs(String family)
Sets the string that defines how to sort the vCard.

2.1 and 3.0 vCards should use the SORT-STRING property instead.

Supported versions: 4.0

Parameters:
family - the sorttable family name (e.g. "Adboville" if the family name is "d'Aboville") or null to remove

setSortAs

public void setSortAs(String family,
                      String given)
Sets the strings that define how to sort the vCard.

2.1 and 3.0 vCards should use the SORT-STRING property instead.

Supported versions: 4.0

Parameters:
family - the sortable family name (e.g. "Adboville" if the family name is "d'Aboville")
given - the sortable given name

getLanguage

public String getLanguage()
Description copied from class: VCardProperty
Gets the language that the property value is written in.

Returns:
the language or null if not set
See Also:
VCardParameters.getLanguage()

setLanguage

public void setLanguage(String language)
Description copied from class: VCardProperty
Sets the language that the property value is written in.

Parameters:
language - the language or null to remove
See Also:
VCardParameters.setLanguage(java.lang.String)

getAltId

public String getAltId()
Description copied from interface: HasAltId
Gets the property's ALTID parameter.

Supported versions: 4.0

Specified by:
getAltId in interface HasAltId
Returns:
the ALTID or null if it doesn't exist
See Also:
VCardParameters.getAltId()

setAltId

public void setAltId(String altId)
Description copied from interface: HasAltId
Sets the property's ALTID parameter.

Supported versions: 4.0

Specified by:
setAltId in interface HasAltId
Parameters:
altId - the ALTID or null to remove
See Also:
VCardParameters.setAltId(java.lang.String)


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.