public class RowVersionTypeDescriptor extends AbstractTypeDescriptor<byte[]>
byte[]
handling specifically used for specifically for entity versions/timestamps.Modifier and Type | Field and Description |
---|---|
static RowVersionTypeDescriptor |
INSTANCE |
Constructor and Description |
---|
RowVersionTypeDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(byte[] one,
byte[] another)
Determine if two instances are equal
|
int |
extractHashCode(byte[] bytes)
Extract a proper hash code for this value.
|
String |
extractLoggableRepresentation(byte[] value)
Extract a loggable representation of the value.
|
byte[] |
fromString(String string) |
Comparator<byte[]> |
getComparator()
Retrieve the natural comparator for this type.
|
String |
toString(byte[] bytes) |
<X> X |
unwrap(byte[] value,
Class<X> type,
WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.
|
<X> byte[] |
wrap(X value,
WrapperOptions options)
Wrap a value as our handled Java type.
|
getJavaTypeClass, getMutabilityPlan, unknownUnwrap, unknownWrap
public static final RowVersionTypeDescriptor INSTANCE
public boolean areEqual(byte[] one, byte[] another)
JavaTypeDescriptor
areEqual
in interface JavaTypeDescriptor<byte[]>
areEqual
in class AbstractTypeDescriptor<byte[]>
one
- One instanceanother
- The other instancepublic int extractHashCode(byte[] bytes)
JavaTypeDescriptor
extractHashCode
in interface JavaTypeDescriptor<byte[]>
extractHashCode
in class AbstractTypeDescriptor<byte[]>
bytes
- The value for which to extract a hash code.public String toString(byte[] bytes)
public String extractLoggableRepresentation(byte[] value)
JavaTypeDescriptor
extractLoggableRepresentation
in interface JavaTypeDescriptor<byte[]>
extractLoggableRepresentation
in class AbstractTypeDescriptor<byte[]>
value
- The value for which to extract a loggable representation.public byte[] fromString(String string)
public Comparator<byte[]> getComparator()
JavaTypeDescriptor
getComparator
in interface JavaTypeDescriptor<byte[]>
getComparator
in class AbstractTypeDescriptor<byte[]>
public <X> X unwrap(byte[] 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> byte[] wrap(X value, WrapperOptions options)
JavaTypeDescriptor
ResultSet
extraction.X
- The conversion type.value
- The value to wrap.options
- The optionsCopyright © 2001-2017 Red Hat, Inc. All Rights Reserved.