public interface JavaTypeDescriptor<T> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
default boolean |
areEqual(T one,
T another)
Determine if two instances are equal
|
default int |
extractHashCode(T value)
Extract a proper hash code for this value.
|
default String |
extractLoggableRepresentation(T value)
Extract a loggable representation of the value.
|
T |
fromString(String string) |
default Comparator<T> |
getComparator()
Retrieve the natural comparator for this type.
|
default Class<T> |
getJavaType()
Get the Java type described
|
Class<T> |
getJavaTypeClass()
Deprecated.
Use
getJavaType() instead |
default MutabilityPlan<T> |
getMutabilityPlan()
Retrieve the mutability plan for this Java type.
|
default String |
toString(T value) |
<X> X |
unwrap(T value,
Class<X> type,
WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.
|
<X> T |
wrap(X value,
WrapperOptions options)
Wrap a value as our handled Java type.
|
@Deprecated Class<T> getJavaTypeClass()
getJavaType() insteaddefault MutabilityPlan<T> getMutabilityPlan()
default Comparator<T> getComparator()
default int extractHashCode(T value)
value - The value for which to extract a hash code.default boolean areEqual(T one, T another)
one - One instanceanother - The other instancedefault String extractLoggableRepresentation(T value)
value - The value for which to extract a loggable representation.<X> X unwrap(T value, Class<X> type, WrapperOptions options)
JavaTypeDescriptor<Integer> and we are asked to unwrap
the Integer value as a Long we would return something like
Long.valueOf( value.longValue() ).
Intended use is during PreparedStatement binding.X - The conversion type.value - The value to unwraptype - The type as which to unwrapoptions - The options<X> T wrap(X value, WrapperOptions options)
ResultSet extraction.X - The conversion type.value - The value to wrap.options - The optionsCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.