public class DateOrTimeProperty extends VCardProperty implements HasAltId
group, parameters| Constructor and Description |
|---|
DateOrTimeProperty(Date date)
Creates a date-and-or-time property.
|
DateOrTimeProperty(Date date,
boolean hasTime)
Creates a date-and-or-time property.
|
DateOrTimeProperty(DateOrTimeProperty original)
Copy constructor.
|
DateOrTimeProperty(PartialDate partialDate)
Creates a date-and-or-time property.
|
DateOrTimeProperty(String text)
Creates a date-and-or-time property.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_validate(List<ValidationWarning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the
spec.
|
boolean |
equals(Object obj) |
String |
getAltId()
Gets the property's ALTID parameter.
|
Calscale |
getCalscale()
Gets the type of calendar that is used for a date or date-time property
value.
|
Date |
getDate()
Gets the date value.
|
String |
getLanguage()
Gets the language that the property value is written in.
|
PartialDate |
getPartialDate()
Gets the reduced accuracy or truncated date.
|
String |
getText()
Gets the text value of this type.
|
int |
hashCode() |
boolean |
hasTime()
Determines whether the "date" or "partialDate" fields have a time
component.
|
void |
setAltId(String altId)
Sets the property's ALTID parameter.
|
void |
setCalscale(Calscale calscale)
Sets the type of calendar that is used for a date or date-time property
value.
|
void |
setDate(Date date,
boolean hasTime)
Sets the value of this property to a complete date.
|
void |
setLanguage(String language)
Sets the language that the property value is written in.
|
void |
setPartialDate(PartialDate partialDate)
Sets the value of this property to a reduced accuracy or truncated date.
|
void |
setText(String text)
Sets the value of this property to a text string.
|
protected Map<String,Object> |
toStringValues()
Gets string representations of the class's fields for the
VCardProperty.toString() method. |
addParameter, compareTo, copy, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, isSupportedBy, removeParameter, setGroup, setParameter, setParameters, toString, validatepublic DateOrTimeProperty(Date date)
date - the date valuepublic DateOrTimeProperty(Date date, boolean hasTime)
date - the date valuehasTime - true to include the date's time component, false if it's
strictly a datepublic DateOrTimeProperty(PartialDate partialDate)
partialDate - the partial date value (vCard 4.0 only)public DateOrTimeProperty(String text)
text - the text value (vCard 4.0 only)public DateOrTimeProperty(DateOrTimeProperty original)
original - the property to make a copy ofpublic void setDate(Date date, boolean hasTime)
date - the datehasTime - true to include the date's time component, false if it's
strictly a datepublic PartialDate getPartialDate()
public void setPartialDate(PartialDate partialDate)
Sets the value of this property to a reduced accuracy or truncated date. This is only supported by vCard 4.0.
Birthday bday = new Birthday(); bday.setPartialDate(PartialDate.date(null, 4, 20)); //April 20
partialDate - the reduced accuracy or truncated datepublic String getText()
public void setText(String text)
text - the text valuepublic boolean hasTime()
public Calscale getCalscale()
Gets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
VCardParameters.getCalscale()public void setCalscale(Calscale calscale)
Sets the type of calendar that is used for a date or date-time property value.
Supported versions: 4.0
calscale - the type of calendar or null to removeVCardParameters.setCalscale(ezvcard.parameter.Calscale)public String getLanguage()
VCardPropertypublic void setLanguage(String language)
VCardPropertylanguage - the language or null to removepublic String getAltId()
HasAltId
Supported versions: 4.0
getAltId in interface HasAltIdVCardParameters.getAltId()public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId in interface HasAltIdaltId - the ALTID or null to removeVCardParameters.setAltId(java.lang.String)protected void _validate(List<ValidationWarning> warnings, VCardVersion version, VCard vcard)
VCardProperty_validate in class VCardPropertywarnings - the list to add the warnings toversion - the version to check the property againstvcard - the vCard this property belongs toprotected Map<String,Object> toStringValues()
VCardProperty
Gets string representations of the class's fields for the
VCardProperty.toString() method.
Meant to be overridden by child classes. The default implementation returns an empty map.
toStringValues in class VCardPropertypublic int hashCode()
hashCode in class VCardPropertypublic boolean equals(Object obj)
equals in class VCardPropertyCopyright © 2012–2018 Michael Angstadt. All rights reserved.