public class DateOrTimeProperty extends VCardProperty implements HasAltId
group, parameters
Constructor and Description |
---|
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.
|
DateOrTimeProperty(Temporal date)
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.
|
Temporal |
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() |
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(Temporal date)
Sets the value of this property to a 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, validate
public DateOrTimeProperty(Temporal date)
date
- the date value (should be one of the following:
LocalDate
, LocalDateTime
, OffsetDateTime
,
Instant
)public 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 Temporal getDate()
LocalDate
, LocalDateTime
,
OffsetDateTime
, Instant
.public void setDate(Temporal date)
LocalDate
, LocalDateTime
,
OffsetDateTime
, Instant
.date
- the 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 value or null if not setpublic 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()
VCardProperty
public void setLanguage(String language)
VCardProperty
language
- the language 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)
protected void _validate(List<ValidationWarning> 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 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 VCardProperty
public int hashCode()
hashCode
in class VCardProperty
public boolean equals(Object obj)
equals
in class VCardProperty
Copyright © 2012–2023 Michael Angstadt. All rights reserved.