public interface JavaTypeDescriptor<T>
extends java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
areEqual(T one,
T another)
Determine if two instances are equal
|
int |
extractHashCode(T value)
Extract a proper hash code for this value.
|
java.lang.String |
extractLoggableRepresentation(T value)
Extract a loggable representation of the value.
|
T |
fromString(java.lang.String string) |
java.util.Comparator<T> |
getComparator()
Retrieve the natural comparator for this type.
|
java.lang.Class<T> |
getJavaTypeClass()
Retrieve the Java type handled here.
|
MutabilityPlan<T> |
getMutabilityPlan()
Retrieve the mutability plan for this Java type.
|
java.lang.String |
toString(T value) |
<X> X |
unwrap(T value,
java.lang.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.
|
java.lang.Class<T> getJavaTypeClass()
MutabilityPlan<T> getMutabilityPlan()
java.util.Comparator<T> getComparator()
int extractHashCode(T value)
value - The value for which to extract a hash code.boolean areEqual(T one, T another)
one - One instanceanother - The other instancejava.lang.String extractLoggableRepresentation(T value)
value - The value for which to extract a loggable representation.java.lang.String toString(T value)
T fromString(java.lang.String string)
<X> X unwrap(T value, java.lang.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-2018 Red Hat, Inc. All Rights Reserved.