Class AbstractAmbiguousTemporal<TYPE extends AbstractAmbiguousTemporal<TYPE>>
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataType<TYPE,ZonedDateTime>
-
- gov.nist.secauto.metaschema.core.datatype.object.AbstractAmbiguousTemporal<TYPE>
-
- Type Parameters:
TYPE
- the bound object type
- All Implemented Interfaces:
ICustomJavaDataType<TYPE>
public abstract class AbstractAmbiguousTemporal<TYPE extends AbstractAmbiguousTemporal<TYPE>> extends AbstractCustomJavaDataType<TYPE,ZonedDateTime>
Metaschema has a need to represent dates and times that allow for an ambiguous time zone. This is due to some models not requiring a time zone as part of a date/time. An ambiguous dateTime allows a time zone to be inferred, without change information in the source content.This class wraps a ZonedDateTime object and tracks if a time zone was found when parsing, which can be used to ensure that the assumed time zone is not written back out in such cases.
-
-
Constructor Summary
Constructors Constructor Description AbstractAmbiguousTemporal(ZonedDateTime value, boolean hasTimeZone)
Construct a new object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasTimeZone()
Indicate if a time zone is configured.-
Methods inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataType
equals, getValue, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.datatype.ICustomJavaDataType
copy
-
-
-
-
Constructor Detail
-
AbstractAmbiguousTemporal
public AbstractAmbiguousTemporal(@NonNull ZonedDateTime value, boolean hasTimeZone)
Construct a new object. This type supports ambiguous dates/times that were provided without a time zone.- Parameters:
value
- the date valuehasTimeZone
-true
if the date is intended to have an associated time zone orfalse
otherwise
-
-
Method Detail
-
hasTimeZone
public boolean hasTimeZone()
Indicate if a time zone is configured.- Returns:
true
if the date is intended to have an associated time zone orfalse
otherwise
-
-