public class UUIDType extends NonNullFieldType<UUID>
UUID
type. Null values are not supported by this class.
Binary encoding is 16 bytes, consisting of the eight high-order bytes followed by the eight low-order bytes.
name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
UUIDType() |
Modifier and Type | Method and Description |
---|---|
int |
compare(UUID uuid1,
UUID uuid2)
Order two field values.
|
UUID |
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. |
UUID |
read(ByteReader reader)
Read a value from the given input.
|
void |
skip(ByteReader reader)
Read and discard a value from the given input.
|
String |
toParseableString(UUID uuid)
Encode a possibly null value as a
String for later decoding by fromParseableString() . |
void |
write(ByteWriter writer,
UUID uuid)
Write a value to the given output.
|
validate
convert, equals, fromString, genericizeForIndex, getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, hashCode, hasPrefix0x00, hasPrefix0xff, 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
public UUID read(ByteReader reader)
FieldType
public void write(ByteWriter writer, UUID uuid)
FieldType
public void skip(ByteReader reader)
FieldType
public UUID fromParseableString(ParseContext ctx)
FieldType
toParseableString()
as a self-delimited String
and positioned at the start of the given parsing context.fromParseableString
in class FieldType<UUID>
ctx
- parse context starting with a string previously encoded via toParseableString()
public String toParseableString(UUID uuid)
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<UUID>
uuid
- actual value (possibly null)value
acceptable to fromParseableString()
public int compare(UUID uuid1, UUID uuid2)
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.
Copyright © 2022. All rights reserved.