T
- The associated Java typepublic class StringEncodedType<T> extends NullSafeType<T>
FieldType
implementation for any Java type that can be encoded uniquely as a String
.
A Converter
is used to convert between native and String
forms.
This class provides a convenient way to implement custom FieldType
s.
Null values are supported and null is the default value. This type will sort instances according to
the lexicographical sort order of their String
encodings; null will sort last.
The supplied Converter
must be Serializable
in order for an instance of this
class to also be Serializable
.
inner, NOT_NULL_SENTINEL, NULL_SENTINEL
name, NAME_PATTERN, REFERENCE_TYPE_NAME, signature, typeToken
Constructor and Description |
---|
StringEncodedType(Class<T> type,
long signature,
Converter<T,String> converter)
Convenience constructor.
|
StringEncodedType(String name,
Class<T> type,
long signature,
Converter<T,String> converter)
Primary constructor.
|
compare, convert, equals, fromParseableString, fromString, genericizeForIndex, hashCode, hasPrefix0x00, hasPrefix0xff, read, skip, toParseableString, toString, write
getDefaultValue, getDefaultValueObject, getEncodingSignature, getKeyRange, getName, getTypeToken, toString, validate, 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 StringEncodedType(Class<T> type, long signature, Converter<T,String> converter)
type
as this FieldType
's type name.type
- represented Java typesignature
- binary encoding signature (in this case, String
encoding signature)converter
- converts between native form and String
form; should be Serializable
IllegalArgumentException
- if converter
does not convert null to nullIllegalArgumentException
- if any parameter is nullpublic StringEncodedType(String name, Class<T> type, long signature, Converter<T,String> converter)
name
- the name for this FieldType
type
- represented Java typesignature
- binary encoding signature (in this case, String
encoding signature)converter
- converts between native form and String
form; should be Serializable
IllegalArgumentException
- if converter
does not convert null to nullIllegalArgumentException
- if any parameter is nullCopyright © 2019. All rights reserved.