public class Organization extends TextListProperty implements HasAltId
Defines a list of organizations the person belongs to. The list is ordered. It begins with the broadest organization and ends with the most specific.
Code sample
VCard vcard = new VCard(); Organization org = new Organization(); org.getValues().add("Google"); org.getValues().add("GMail Team"); org.getValues().add("Spam Detection Team"); vcard.setOrganization(org);
Property name: ORG
Supported versions: 2.1, 3.0, 4.0
values
group, parameters
Constructor and Description |
---|
Organization() |
Organization(Organization original)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Organization |
copy()
Creates a copy of this property object.
|
String |
getAltId()
Gets the property's ALTID parameter.
|
String |
getLanguage()
Gets the language that the property value is written in.
|
List<Pid> |
getPids()
Gets the list that stores this property's PID (property ID) parameter
values.
|
Integer |
getPref()
Gets this property's preference value.
|
List<String> |
getSortAs()
Gets the list that holds string(s) which define how to sort the vCard.
|
String |
getType()
Gets the TYPE parameter.
|
void |
setAltId(String altId)
Sets the property's ALTID parameter.
|
void |
setLanguage(String language)
Sets the language that the property value is written in.
|
void |
setPref(Integer pref)
Sets this property's preference value.
|
void |
setSortAs(String sortString)
Sets the sort string for this property.
|
void |
setType(String type)
Sets the TYPE parameter.
|
_validate, equals, getValues, hashCode, toStringValues
addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, isSupportedBy, removeParameter, setGroup, setParameter, setParameters, toString, validate
public Organization()
public Organization(Organization original)
original
- the property to make a copy ofpublic String getLanguage()
VCardProperty
public void setLanguage(String language)
VCardProperty
language
- the language or null to removepublic String getType()
Supported versions: 4.0
public void setType(String type)
Supported versions: 4.0
type
- the TYPE value (this should be either "work" or "home") or
null to removepublic List<Pid> getPids()
VCardProperty
Gets the list that stores this property's PID (property ID) parameter values.
PIDs can exist on any property where multiple instances are allowed (such
as Email
or Address
, but not StructuredName
because only 1 instance of this property is allowed per vCard).
When used in conjunction with the ClientPidMap
property, it
allows an individual property instance to be uniquely identifiable. This
feature is made use of when two different versions of the same vCard have
to be merged together (called "synchronizing").
Supported versions: 4.0
public Integer getPref()
VCardProperty
Gets this property's preference value. The lower this number is, the more "preferred" the property instance is compared with other properties of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the Address
on the second row is the most
preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2:;;1600 Amphitheatre Parkway;Mountain View;CA;94043 ADR;TYPE=work;PREF=1:;;One Microsoft Way;Redmond;WA;98052 ADR;TYPE=home:;;123 Maple St;Hometown;KS;12345
Supported versions: 4.0
public void setPref(Integer pref)
VCardProperty
Sets this property's preference value. The lower this number is, the more "preferred" the property instance is compared with other properties of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
In the vCard below, the Address
on the second row is the most
preferred because it has the lowest PREF value.
ADR;TYPE=work;PREF=2:;;1600 Amphitheatre Parkway;Mountain View;CA;94043 ADR;TYPE=work;PREF=1:;;One Microsoft Way;Redmond;WA;98052 ADR;TYPE=home:;;123 Maple St;Hometown;KS;12345
Supported versions: 4.0
pref
- the preference value or null to removepublic String getAltId()
HasAltId
Supported versions: 4.0
getAltId
in interface HasAltId
VCardParameters.getAltId()
public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId
in interface HasAltId
altId
- the ALTID or null to removeVCardParameters.setAltId(java.lang.String)
public List<String> getSortAs()
Gets the list that holds string(s) which define how to sort the vCard.
2.1 and 3.0 vCards should use the SortString
property instead.
Supported versions: 4.0
public void setSortAs(String sortString)
Sets the sort string for this property.
2.1 and 3.0 vCards should use the SortString
property instead.
Supported versions: 4.0
sortString
- the sort string or null to removepublic Organization copy()
VCardProperty
Creates a copy of this property object.
The default implementation of this method uses reflection to look for a copy constructor. Child classes SHOULD override this method to avoid the performance overhead involved in using reflection.
The child class's copy constructor, if present, MUST invoke the
VCardProperty.VCardProperty(VCardProperty)
super constructor to ensure that
the group name and parameters are also copied.
This method MUST be overridden by the child class if the child class does
not have a copy constructor. Otherwise, an
UnsupportedOperationException
will be thrown when an attempt is
made to copy the property (such as in the VCard
class's copy constructor
).
copy
in class VCardProperty
Copyright © 2012–2023 Michael Angstadt. All rights reserved.