Package org.cip4.lib.xjdf.type
Class DateTime
java.lang.Object
Implementation of the XJDF DateTime data type.
-
Constructor Summary
ConstructorsConstructorDescriptionDateTime()Default constructor.DateTime(int year, int month, int day) Custom constructor.DateTime(int year, int month, int day, int hour, int minute) Custom constructor.DateTime(int year, int month, int day, int hour, int minute, int second) Custom constructor.Custom constructor.DateTime(long epochMillis) Creates a XJDF DateTime instance by a Date object.Creates a XJDF DateTime instance by a String expression object.DateTime(ZonedDateTime zonedDateTime) Custom constructor.Creates a XJDF DateTime instance by a Date object. -
Method Summary
Modifier and TypeMethodDescriptionfinal CalendarClones the underlying calendar and returns it.final ZonedDateTimeReturns the zoned date time object representing the date times value.final Stringfinal longReturns the DateTime value as epoch millis.final StringtoString()final Stringfinal DateTimeMethods inherited from class org.cip4.lib.xjdf.type.AbstractXJdfType
equals, hashCode
-
Constructor Details
-
DateTime
public DateTime()Default constructor. -
DateTime
Custom constructor. Accepting a ZonedDateTime object for initializing. -
DateTime
public DateTime(int year, int month, int day) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.
-
DateTime
public DateTime(int year, int month, int day, int hour, int minute) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.hour- The value used to set the HOUR of day.minute- The value used to set the MINUTE in of.
-
DateTime
public DateTime(int year, int month, int day, int hour, int minute, int second) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.hour- The value used to set the HOUR of day.minute- The value used to set the MINUTE.second- The value used to set the SECOND.
-
DateTime
public DateTime(int year, int month, int day, int hour, int minute, int second, int millis, ZoneId zoneId) Custom constructor. Accepting values for initializing.- Parameters:
year- The value used to set the YEAR.month- The value used to set the MONTH in year. January is "0".day- The value used to set the DAY in month.hour- The value used to set the HOUR of day.minute- The value used to set the MINUTE.second- The value used to set the SECOND.millis- The value used to set the MILLISECONDSzoneId- The zone id.
-
DateTime
Creates a XJDF DateTime instance by a String expression object.- Parameters:
dateTime- XJDF DateTime String expression. Should match the format yyyy-MM-dd'T'HH:mm:ss'Z'.- Throws:
ParseException- if the passed expression
-
DateTime
Creates a XJDF DateTime instance by a Date object.- Parameters:
date- Date object.
-
DateTime
public DateTime(long epochMillis) Creates a XJDF DateTime instance by a Date object.- Parameters:
epochMillis- Epoch millis.
-
-
Method Details
-
getCalendar
Clones the underlying calendar and returns it.- Returns:
- the cloned calendar
-
toEpochMillis
public final long toEpochMillis()Returns the DateTime value as epoch millis.- Returns:
- The DateTime value as epoch millis.
-
getZonedDateTime
Returns the zoned date time object representing the date times value.- Returns:
- The ZonedDateTime object.
-
marshal
-
unmarshal
-
toString
- Specified by:
toStringin classAbstractXJdfType<String,DateTime> - See Also:
-
toString
- See Also:
-