public interface JavaTypeDescriptor<T> extends 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.
|
String |
extractLoggableRepresentation(T value)
Extract a loggable representation of the value.
|
T |
fromString(String string) |
Comparator<T> |
getComparator()
Retrieve the natural comparator for this type.
|
Class<T> |
getJavaTypeClass()
Retrieve the Java type handled here.
|
MutabilityPlan<T> |
getMutabilityPlan()
Retrieve the mutability plan for this Java type.
|
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.
|
Class<T> getJavaTypeClass()
MutabilityPlan<T> getMutabilityPlan()
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 instanceString 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-2017 Red Hat, Inc. All Rights Reserved.