Class XMLGregorianCalendarValue

java.lang.Object
com.iizix.value.XMLGregorianCalendarValue
All Implemented Interfaces:
IValueObject<ImmutableXMLGregorianCalendar>

public class XMLGregorianCalendarValue extends Object implements IValueObject<ImmutableXMLGregorianCalendar>
Value object class to handle the XMLGregorianCalendar datatype.

Zones. A source that carries its own offset (OffsetDateTime, ZonedDateTime, OffsetTime, a zoned calendar) keeps it. A source that names an instant (a Number of milliseconds, a java.util.Date, the asLong channel) is read in the session's zone and stamped with the offset that zone has at the instant. A LocalDateTime is stamped with the offset the session's zone has at that local reading, a bare LocalTime with the session's own offset. A java.sql.Timestamp is WALL-CLOCK: the fields a JDBC driver stored, recovered by Timestamp.toLocalDateTime() and stamped as a LocalDateTime is - the reading the OffsetDateTime, ZonedDateTime, LocalDateTime, LocalTime and OffsetTime arms give a Timestamp, so every route from a Timestamp to a calendar denotes one instant (CC-DEFECT-FIX-N7 ruling D-1, taken on the premise that the Timestamps reaching a Value are JDBC column values; a Timestamp built from milliseconds is an instant and belongs in a java.util.Date). A date-only source (LocalDate, Year, YearMonth, MonthDay) names no instant and no zone: its calendar carries NO zone, so one date is one calendar whatever the session converts it, and is read back in the session's zone by the zoned targets and asLong, as every zone-less calendar is (ruling D-8).

Author:
Christopher Mindus