public class CalendarDateTypeDescriptor extends AbstractTypeDescriptor<java.util.Calendar>
Calendar
handling, but just for the date (month, day, year) portion.Modifier and Type | Field and Description |
---|---|
static CalendarDateTypeDescriptor |
INSTANCE |
Modifier | Constructor and Description |
---|---|
protected |
CalendarDateTypeDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(java.util.Calendar one,
java.util.Calendar another)
Determine if two instances are equal
|
int |
extractHashCode(java.util.Calendar value)
Extract a proper hash code for this value.
|
java.util.Calendar |
fromString(java.lang.String string) |
java.util.Comparator<java.util.Calendar> |
getComparator()
Retrieve the natural comparator for this type.
|
java.lang.String |
toString(java.util.Calendar value) |
<X> X |
unwrap(java.util.Calendar value,
java.lang.Class<X> type,
WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.
|
<X> java.util.Calendar |
wrap(X value,
WrapperOptions options)
Wrap a value as our handled Java type.
|
extractLoggableRepresentation, getJavaType, getJavaTypeClass, getMutabilityPlan, unknownUnwrap, unknownWrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getJdbcRecommendedSqlType
public static final CalendarDateTypeDescriptor INSTANCE
public java.lang.String toString(java.util.Calendar value)
public java.util.Calendar fromString(java.lang.String string)
public boolean areEqual(java.util.Calendar one, java.util.Calendar another)
JavaTypeDescriptor
areEqual
in interface JavaTypeDescriptor<java.util.Calendar>
areEqual
in class AbstractTypeDescriptor<java.util.Calendar>
one
- One instanceanother
- The other instancepublic int extractHashCode(java.util.Calendar value)
JavaTypeDescriptor
extractHashCode
in interface JavaTypeDescriptor<java.util.Calendar>
extractHashCode
in class AbstractTypeDescriptor<java.util.Calendar>
value
- The value for which to extract a hash code.public java.util.Comparator<java.util.Calendar> getComparator()
JavaTypeDescriptor
getComparator
in interface JavaTypeDescriptor<java.util.Calendar>
getComparator
in class AbstractTypeDescriptor<java.util.Calendar>
public <X> X unwrap(java.util.Calendar value, java.lang.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> java.util.Calendar wrap(X value, WrapperOptions options)
JavaTypeDescriptor
ResultSet
extraction.X
- The conversion type.value
- The value to wrap.options
- The optionsCopyright © 2001-2019 Red Hat, Inc. All Rights Reserved.