XmpDate Class
An XMP metadata date value.
Declaration
public class XmpDate extends XmpValue implements IEquatable<XmpDate>, IComparable<XmpDate>
Implements
Inherited Members
Inheritance
Constructors
XmpDate() Constructor
Initializes a new instance of the XmpDate class.
Declaration
public XmpDate()
XmpDate(Instant value, XmpDatePrecision precision) Constructor
Initializes a new instance of the XmpDate class with specified instant value and precision.
Declaration
public XmpDate(Instant value, XmpDatePrecision precision)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Instant | The instant value. |
| precision | XmpDatePrecision | The precision of the date value. |
XmpDate(Instant value) Constructor
Initializes a new instance of the XmpDate class with the specified instant value.
Declaration
public XmpDate(Instant value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | Instant | The instant value. |
XmpDate(OffsetDateTime value, XmpDatePrecision precision) Constructor
Initializes a new instance of the XmpDate class with specified value and precision.
Declaration
public XmpDate(OffsetDateTime value, XmpDatePrecision precision)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OffsetDateTime | The date and time value. |
| precision | XmpDatePrecision | The precision of the date value. |
XmpDate(OffsetDateTime value) Constructor
Initializes a new instance of the XmpDate class with specified value.
Declaration
public XmpDate(OffsetDateTime value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OffsetDateTime | The date and time value. |
Methods
compareTo(XmpDate other) Method
Compares the current XMP date with another XMP date.
Declaration
public int compareTo(XmpDate other)
Parameters
| Name | Type | Description |
|---|---|---|
| other | XmpDate |
The XMP date to compare with this object. |
Returns
| Type | Description |
|---|---|
| int | A value that indicates the relative order of the compared objects. |
equals(Object obj) Method
Determines whether the current XMP date is equal to the specified object.
Declaration
public boolean equals(Object obj)
Parameters
| Name | Type | Description |
|---|---|---|
| obj | Object | The object to compare with this object. |
Returns
| Type | Description |
|---|---|
| boolean |
|
equals(XmpDate other) Method
Determines whether the current XMP date is equal to another XMP date.
Declaration
public boolean equals(XmpDate other)
Parameters
| Name | Type | Description |
|---|---|---|
| other | XmpDate |
The XMP date to compare with this object. |
Returns
| Type | Description |
|---|---|
| boolean |
|
getDateValue() Method
Gets the date and time value.
Declaration
public OffsetDateTime getDateValue()
Returns
| Type | Description |
|---|---|
| OffsetDateTime | The date and time value. |
getHasValue() Method
Returns whether the value is successfully parsed.
Declaration
public boolean getHasValue()
Returns
| Type | Description |
|---|---|
| boolean |
|
getNow() Method
Returns an XMP date value that represents the current local date and time.
Declaration
public static XmpDate getNow()
Returns
| Type | Description |
|---|---|
XmpDate |
The current local date and time. |
getPrecision() Method
Returns the precision of the date value.
Declaration
public @Nullable XmpDatePrecision getPrecision()
Returns
| Type | Description |
|---|---|
| XmpDatePrecision | The precision of the date value, or |
getUtcNow() Method
Returns an XMP date value that represents the current UTC date and time.
Declaration
public static XmpDate getUtcNow()
Returns
| Type | Description |
|---|---|
XmpDate |
The current UTC date and time. |
hashCode() Method
Returns the hash code for the current XMP date.
Declaration
public int hashCode()
Returns
| Type | Description |
|---|---|
| int | The hash code |
toString() Method
Returns the raw string representation of the XMP date value.
Declaration
public String toString()
Returns
| Type | Description |
|---|---|
| String | The raw string representation of the value. |
tryParse(String value, XmpDate[] result, Runnable result_sync) Method
Converts the specified string representation of an XMP date to an XmpDate object.
Declaration
public static boolean tryParse(String value, XmpDate[] result, Runnable result_sync)
Parameters
| Name | Type | Description |
|---|---|---|
| value | String | The string representation of the date value. |
| result | XmpDate[] | An array that receives the parsed XmpDate object. |
| result_sync | Runnable | The callback invoked after the result is updated. |
Returns
| Type | Description |
|---|---|
| boolean |
|