Package io.permazen.encoding
Class OffsetDateTimeEncoding
java.lang.Object
io.permazen.encoding.AbstractEncoding<T>
io.permazen.encoding.ConvertedEncoding<T,Tuple2<V1,V2>>
io.permazen.encoding.Concat2Encoding<OffsetDateTime,Instant,ZoneOffset>
io.permazen.encoding.OffsetDateTimeEncoding
- All Implemented Interfaces:
Encoding<OffsetDateTime>
,NaturalSortAware
,Serializable
,Comparator<OffsetDateTime>
Non-null
OffsetDateTime
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 Instant
and ZoneOffset
.
- 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
(OffsetDateTime offsetDateTime) 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
-
OffsetDateTimeEncoding
public OffsetDateTimeEncoding()
-
-
Method Details
-
fromString
Description copied from interface:Encoding
Parse a non-null value previously encoded bytoString(T)
.- Specified by:
fromString
in interfaceEncoding<OffsetDateTime>
- Overrides:
fromString
in classConvertedEncoding<OffsetDateTime,
Tuple2<Instant, ZoneOffset>> - 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<OffsetDateTime>
- Overrides:
toString
in classConvertedEncoding<OffsetDateTime,
Tuple2<Instant, ZoneOffset>> - Parameters:
offsetDateTime
- 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<OffsetDateTime,
Tuple2<Instant, ZoneOffset>> - Returns:
- true if this instance orders Java values in their natural order
- This class also implements
-