Interface JavaTypeDescriptor<T>
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
BasicJavaDescriptor<T>
- All Known Implementing Classes:
AbstractTypeDescriptor,BigDecimalTypeDescriptor,BigIntegerTypeDescriptor,BlobTypeDescriptor,BooleanTypeDescriptor,ByteArrayTypeDescriptor,ByteTypeDescriptor,CalendarDateTypeDescriptor,CalendarTimeTypeDescriptor,CalendarTypeDescriptor,CharacterArrayTypeDescriptor,CharacterTypeDescriptor,ClassTypeDescriptor,ClobTypeDescriptor,CurrencyTypeDescriptor,DateTypeDescriptor,DoubleTypeDescriptor,DurationJavaDescriptor,EnumJavaTypeDescriptor,FloatTypeDescriptor,GeolatteGeometryJavaTypeDescriptor,InstantJavaDescriptor,IntegerTypeDescriptor,JavaTypeDescriptorRegistry.FallbackJavaTypeDescriptor,JdbcDateTypeDescriptor,JdbcTimestampTypeDescriptor,JdbcTimeTypeDescriptor,JTSGeometryJavaTypeDescriptor,LocalDateJavaDescriptor,LocalDateTimeJavaDescriptor,LocaleTypeDescriptor,LocalTimeJavaDescriptor,LongTypeDescriptor,NClobTypeDescriptor,OffsetDateTimeJavaDescriptor,OffsetTimeJavaDescriptor,PrimitiveByteArrayTypeDescriptor,PrimitiveCharacterArrayTypeDescriptor,RowVersionTypeDescriptor,SerializableTypeDescriptor,ShortTypeDescriptor,StringTypeDescriptor,TimeZoneTypeDescriptor,UrlTypeDescriptor,UUIDTypeDescriptor,ZonedDateTimeJavaDescriptor
public interface JavaTypeDescriptor<T> extends java.io.SerializableDescriptor for the Java side of a value mapping.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default booleanareEqual(T one, T another)Determine if two instances are equaldefault intextractHashCode(T value)Extract a proper hash code for this value.default java.lang.StringextractLoggableRepresentation(T value)Extract a loggable representation of the value.TfromString(java.lang.String string)default java.util.Comparator<T>getComparator()Retrieve the natural comparator for this type.default java.lang.Class<T>getJavaType()Get the Java type describedjava.lang.Class<T>getJavaTypeClass()Deprecated.UsegetJavaType()insteaddefault MutabilityPlan<T>getMutabilityPlan()Retrieve the mutability plan for this Java type.default java.lang.StringtoString(T value)<X> Xunwrap(T value, java.lang.Class<X> type, WrapperOptions options)Unwrap an instance of our handled Java type into the requested type.<X> Twrap(X value, WrapperOptions options)Wrap a value as our handled Java type.
-
-
-
Method Detail
-
getJavaTypeClass
@Deprecated java.lang.Class<T> getJavaTypeClass()
Deprecated.UsegetJavaType()insteadRetrieve the Java type handled here.- Returns:
- The Java type.
-
getJavaType
default java.lang.Class<T> getJavaType()
Get the Java type described
-
getMutabilityPlan
default MutabilityPlan<T> getMutabilityPlan()
Retrieve the mutability plan for this Java type.
-
getComparator
default java.util.Comparator<T> getComparator()
Retrieve the natural comparator for this type.
-
extractHashCode
default int extractHashCode(T value)
Extract a proper hash code for this value.- Parameters:
value- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
areEqual
default boolean areEqual(T one, T another)
Determine if two instances are equal- Parameters:
one- One instanceanother- The other instance- Returns:
- True if the two are considered equal; false otherwise.
-
extractLoggableRepresentation
default java.lang.String extractLoggableRepresentation(T value)
Extract a loggable representation of the value.- Parameters:
value- The value for which to extract a loggable representation.- Returns:
- The loggable representation
-
toString
default java.lang.String toString(T value)
-
fromString
T fromString(java.lang.String string)
-
unwrap
<X> X unwrap(T value, java.lang.Class<X> type, WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type. As an example, if this is aJavaTypeDescriptor<Integer>and we are asked to unwrap theInteger valueas aLongwe would return something likeLong.valueOf( value.longValue() ). Intended use is duringPreparedStatementbinding.- Type Parameters:
X- The conversion type.- Parameters:
value- The value to unwraptype- The type as which to unwrapoptions- The options- Returns:
- The unwrapped value.
-
wrap
<X> T wrap(X value, WrapperOptions options)
Wrap a value as our handled Java type. Intended use is duringResultSetextraction.- Type Parameters:
X- The conversion type.- Parameters:
value- The value to wrap.options- The options- Returns:
- The wrapped value.
-
-