public class OffsetDateTimeType extends NonNullFieldType<T>
OffsetDateTime
type. Null values are not supported by this class.
Binary encoding is via the concatenation of the encodings of Instant
and ZoneOffset
.
Modifier and Type | Field and Description |
---|---|
protected FieldType<S1> |
type1 |
protected FieldType<S2> |
type2 |
name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
OffsetDateTimeType() |
Modifier and Type | Method and Description |
---|---|
int |
compare(T value1,
T value2)
Order two field values.
|
OffsetDateTime |
fromParseableString(ParseContext ctx)
Parse a value previously encoded by
toParseableString() as a self-delimited String
and positioned at the start of the given parsing context. |
boolean |
hasPrefix0x00()
Determine whether any of this field type's encoded values start with a
0x00 byte. |
boolean |
hasPrefix0xff()
Determine whether any of this field type's encoded values start with a
0xff byte. |
protected OffsetDateTime |
join(Instant value1,
ZoneOffset value2) |
T |
read(ByteReader reader)
Read a value from the given input.
|
void |
skip(ByteReader reader)
Read and discard a value from the given input.
|
protected Instant |
split1(OffsetDateTime value) |
protected ZoneOffset |
split2(OffsetDateTime value) |
String |
toParseableString(OffsetDateTime offsetDateTime)
Encode a possibly null value as a
String for later decoding by fromParseableString() . |
void |
write(ByteWriter writer,
T value)
Write a value to the given output.
|
validate
convert, equals, fromString, genericizeForIndex, getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, hashCode, toString, toString, validateAndWrite
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected OffsetDateTime join(Instant value1, ZoneOffset value2)
protected Instant split1(OffsetDateTime value)
protected ZoneOffset split2(OffsetDateTime value)
public OffsetDateTime fromParseableString(ParseContext ctx)
FieldType
toParseableString()
as a self-delimited String
and positioned at the start of the given parsing context.fromParseableString
in class FieldType<OffsetDateTime>
ctx
- parse context starting with a string previously encoded via toParseableString()
public String toParseableString(OffsetDateTime offsetDateTime)
FieldType
String
for later decoding by fromParseableString()
.
The string value must be self-delimiting, i.e., decodable even when followed by arbitrary additional characters,
and must not start with whitespace or closing square bracket ("]"
).
In addition, each of the characters in the returned String
must be one of the valid XML characters
(tab, newline, carriage return, \u0020 - \ud7ff
, and \ue000 - \fffdf
).
toParseableString
in class FieldType<OffsetDateTime>
offsetDateTime
- actual value (possibly null)value
acceptable to fromParseableString()
public T read(ByteReader reader)
FieldType
public void write(ByteWriter writer, T value)
FieldType
public void skip(ByteReader reader)
FieldType
public int compare(T value1, T value2)
FieldType
This method must provide a total ordering of all supported Java values that is consistent with the database ordering,
i.e., the unsigned lexicographical ordering of the corresponding byte[]
encoded field values.
If null is a supported Java value, then the returned Comparator
must accept null parameters without
throwing an exception (note, this is a stronger requirement than the Comparator
interface normally requires).
Note: by convention, null values usually sort last.
compare
in interface Comparator<T>
compare
in class FieldType<T>
public boolean hasPrefix0x00()
FieldType
0x00
byte.
Certain optimizations are possible when this is not the case. It is safe for this method to always return true.
Note: changing the return value of this method usually means changing the binary encoding, resulting in an incompatible type.
The implementation in FieldType
returns true
.
hasPrefix0x00
in class FieldType<T>
0x00
existspublic boolean hasPrefix0xff()
FieldType
0xff
byte.
Certain optimizations are possible when this is not the case. It is safe for this method to always return true.
Note: changing the return value of this method usually means changing the binary encoding, resulting in an incompatible type.
The implementation in FieldType
returns true
.
hasPrefix0xff
in class FieldType<T>
0xff
existsCopyright © 2022. All rights reserved.