|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.Gender
public class Gender
Defines the person's sex.
Setting the gender
VCard vcard = new VCard(); Gender gender = Gender.male(); vcard.setGender(gender);
Getting the gender
VCard vcard = ... Gender gender = vcard.getGender(); if (gender != null){ if (gender.isMale()){ ... } else if (gender.isFemale()){ ... } ... }
Property name: GENDER
Supported versions: 4.0
Field Summary | |
---|---|
static String |
FEMALE
|
static String |
MALE
|
static String |
NONE
|
static String |
OTHER
|
static String |
UNKNOWN
|
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
Gender(String gender)
Creates a gender 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. |
static Gender |
female()
Creates a gender property whose value is set to "female". |
String |
getGender()
Gets the gender value. |
String |
getText()
Gets the additional text associated with this property. |
boolean |
isFemale()
Determines if the gender is "female" or not. |
boolean |
isMale()
Determines if the gender is "male" or not. |
boolean |
isNone()
Determines if the gender is "none" or not. |
boolean |
isOther()
Determines if the gender is "other" or not. |
boolean |
isUnknown()
Determines if the gender is "unknown" or not. |
static Gender |
male()
Creates a gender property whose value is set to "male". |
static Gender |
none()
Creates a gender property whose value is set to "none". |
static Gender |
other()
Creates a gender property whose value is set to "other". |
void |
setGender(String gender)
Sets the gender value. |
void |
setText(String text)
Sets the additional text associated with this property. |
static Gender |
unknown()
Creates a gender property whose value is set to "unknown". |
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 |
Field Detail |
---|
public static final String MALE
public static final String FEMALE
public static final String OTHER
public static final String NONE
public static final String UNKNOWN
Constructor Detail |
---|
public Gender(String gender)
gender
- the gender value (e.g. "F")Method Detail |
---|
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 String getText()
public void setText(String text)
text
- additional text or null to removepublic String getGender()
public void setGender(String gender)
gender
- the gender value (see static strings for the possible
values)public boolean isMale()
public boolean isFemale()
public boolean isOther()
public boolean isNone()
public boolean isUnknown()
public static Gender male()
public static Gender female()
public static Gender other()
public static Gender none()
public static Gender unknown()
protected 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 |