Package io.permazen.encoding
Class ZonedDateTimeEncoding
java.lang.Object
io.permazen.encoding.AbstractEncoding<T>
io.permazen.encoding.ConvertedEncoding<T,Tuple2<V1,V2>>
io.permazen.encoding.Concat2Encoding<ZonedDateTime,OffsetDateTime,ZoneId>
io.permazen.encoding.ZonedDateTimeEncoding
- All Implemented Interfaces:
Encoding<ZonedDateTime>
,NaturalSortAware
,Serializable
,Comparator<ZonedDateTime>
Non-null
ZonedDateTime
type.
Null values are not supported by this class and there is no default value.
Binary encoding is via the concatenation of the encodings of OffsetDateTimeEncoding
and ZoneIdEncoding
.
- See Also:
-
Field Summary
Fields inherited from class io.permazen.encoding.ConvertedEncoding
converter, delegate
Fields inherited from class io.permazen.encoding.AbstractEncoding
encodingId, typeToken
Fields inherited from interface io.permazen.encoding.Encoding
MAX_ARRAY_DIMENSIONS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromString
(String string) Parse a non-null value previously encoded bytoString(T)
.boolean
Determine if this instance sorts Java instances naturally.toString
(ZonedDateTime zonedDateTime) Encode a non-null value as aString
for later decoding byfromString()
.Methods inherited from class io.permazen.encoding.Concat2Encoding
getTuple2Encoding
Methods inherited from class io.permazen.encoding.ConvertedEncoding
compare, equals, getFixedWidth, hashCode, hasPrefix0x00, hasPrefix0xff, read, skip, supportsNull, validate, write
Methods inherited from class io.permazen.encoding.AbstractEncoding
getDefaultValue, getDefaultValueBytes, getEncodingId, getTypeToken, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface io.permazen.encoding.Encoding
convert, decode, encode, getKeyRange, validateAndWrite
-
Constructor Details
-
ZonedDateTimeEncoding
public ZonedDateTimeEncoding()
-
-
Method Details
-
fromString
Description copied from interface:Encoding
Parse a non-null value previously encoded bytoString(T)
.- Specified by:
fromString
in interfaceEncoding<ZonedDateTime>
- Overrides:
fromString
in classConvertedEncoding<ZonedDateTime,
Tuple2<OffsetDateTime, ZoneId>> - Parameters:
string
- non-null value previously encoded as aString
bytoString(T)
- Returns:
- actual value
-
toString
Description copied from interface:Encoding
Encode a non-null value as aString
for later decoding byfromString()
.Each of the characters in the returned
String
, when decoded as 32-bit Unicode codepoints, must contain only valid XML characters (seeXMLUtil.isValidChar(int)
).- Specified by:
toString
in interfaceEncoding<ZonedDateTime>
- Overrides:
toString
in classConvertedEncoding<ZonedDateTime,
Tuple2<OffsetDateTime, ZoneId>> - Parameters:
zonedDateTime
- actual value, never null- Returns:
- string encoding of
value
acceptable tofromString()
- See Also:
-
sortsNaturally
public boolean sortsNaturally()Description copied from interface:NaturalSortAware
Determine if this instance sorts Java instances naturally.This method should return true only if all of the following are true:
- This class also implements
Comparator
for some Java typeT
. - Type
T
has a natural ordering (i.e.,T
itself implementsComparable
). - The ordering implied by this class's
compare()
method is identical toT
's natural ordering.
- Specified by:
sortsNaturally
in interfaceNaturalSortAware
- Overrides:
sortsNaturally
in classConvertedEncoding<ZonedDateTime,
Tuple2<OffsetDateTime, ZoneId>> - Returns:
- true if this instance orders Java values in their natural order
- This class also implements
-