public class BlobTypeDescriptor extends AbstractTypeDescriptor<Blob>
Descriptor for Blob
handling.
<p/>
Note, blobs
really are mutable (their internal state can in fact be mutated). We simply
treat them as immutable because we cannot properly check them for changes nor deep copy them.
Modifier and Type | Class and Description |
---|---|
static class |
BlobTypeDescriptor.BlobMutabilityPlan |
Modifier and Type | Field and Description |
---|---|
static BlobTypeDescriptor |
INSTANCE |
Constructor and Description |
---|
BlobTypeDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(Blob one,
Blob another)
Determine if two instances are equal
|
int |
extractHashCode(Blob value)
Extract a proper hash code for this value.
|
String |
extractLoggableRepresentation(Blob value)
Extract a loggable representation of the value.
|
Blob |
fromString(String string) |
Comparator<Blob> |
getComparator()
Retrieve the natural comparator for this type.
|
String |
toString(Blob value) |
<X> X |
unwrap(Blob value,
Class<X> type,
WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.
|
<X> Blob |
wrap(X value,
WrapperOptions options)
Wrap a value as our handled Java type.
|
getJavaType, getJavaTypeClass, getMutabilityPlan, unknownUnwrap, unknownWrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getJdbcRecommendedSqlType
public static final BlobTypeDescriptor INSTANCE
public String extractLoggableRepresentation(Blob value)
JavaTypeDescriptor
Extract a loggable representation of the value.
extractLoggableRepresentation
in interface JavaTypeDescriptor<Blob>
extractLoggableRepresentation
in class AbstractTypeDescriptor<Blob>
value
- The value for which to extract a loggable representation.public Comparator<Blob> getComparator()
JavaTypeDescriptor
Retrieve the natural comparator for this type.
getComparator
in interface JavaTypeDescriptor<Blob>
getComparator
in class AbstractTypeDescriptor<Blob>
public int extractHashCode(Blob value)
JavaTypeDescriptor
Extract a proper hash code for this value.
extractHashCode
in interface JavaTypeDescriptor<Blob>
extractHashCode
in class AbstractTypeDescriptor<Blob>
value
- The value for which to extract a hash code.public boolean areEqual(Blob one, Blob another)
JavaTypeDescriptor
Determine if two instances are equal
areEqual
in interface JavaTypeDescriptor<Blob>
areEqual
in class AbstractTypeDescriptor<Blob>
one
- One instanceanother
- The other instancepublic <X> X unwrap(Blob value, Class<X> type, WrapperOptions options)
JavaTypeDescriptor
Unwrap an instance of our handled Java type into the requested type.
<p/>
As an example, if this is a JavaTypeDescriptor<Integer>
and we are asked to unwrap
the Integer value
as a Long
we would return something like
<code>Long.valueOf( value.longValue() )</code>.
<p/>
Intended use is during PreparedStatement
binding.
X
- The conversion type.value
- The value to unwraptype
- The type as which to unwrapoptions
- The optionspublic <X> Blob wrap(X value, WrapperOptions options)
JavaTypeDescriptor
Wrap a value as our handled Java type.
<p/>
Intended use is during ResultSet
extraction.
X
- The conversion type.value
- The value to wrap.options
- The optionsCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.