public class SerializableTypeDescriptor<T extends Serializable> extends AbstractTypeDescriptor<T>
Serializable
handling.Modifier and Type | Class and Description |
---|---|
static class |
SerializableTypeDescriptor.SerializableMutabilityPlan<S extends Serializable> |
Constructor and Description |
---|
SerializableTypeDescriptor(Class<T> type) |
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.
|
protected T |
fromBytes(byte[] bytes) |
T |
fromString(String string) |
protected byte[] |
toBytes(T value) |
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.
|
extractLoggableRepresentation, getComparator, getJavaType, getJavaTypeClass, getMutabilityPlan, unknownUnwrap, unknownWrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getJdbcRecommendedSqlType
public boolean areEqual(T one, T another)
JavaTypeDescriptor
areEqual
in interface JavaTypeDescriptor<T extends Serializable>
areEqual
in class AbstractTypeDescriptor<T extends Serializable>
one
- One instanceanother
- The other instancepublic int extractHashCode(T value)
JavaTypeDescriptor
extractHashCode
in interface JavaTypeDescriptor<T extends Serializable>
extractHashCode
in class AbstractTypeDescriptor<T extends Serializable>
value
- The value for which to extract a hash code.public <X> X unwrap(T value, Class<X> type, WrapperOptions options)
JavaTypeDescriptor
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 optionspublic <X> T wrap(X value, WrapperOptions options)
JavaTypeDescriptor
ResultSet
extraction.X
- The conversion type.value
- The value to wrap.options
- The optionsprotected byte[] toBytes(T value)
protected T fromBytes(byte[] bytes)
Copyright © 2021 JBoss by Red Hat. All rights reserved.