Class DefaultJavaUtilCalendarBridge
java.lang.Object
org.hibernate.search.mapper.pojo.bridge.builtin.impl.DefaultJavaUtilCalendarBridge
- All Implemented Interfaces:
AutoCloseable,IdentifierBridge<Calendar>,ValueBridge<Calendar,ZonedDateTime>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Close any resource before the bridge is discarded.protected CalendarfromConvertedValue(ZonedDateTime value) final CalendarfromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context) Transform the given document identifier value back to the value of the POJO property.final CalendarfromIndexedValue(ZonedDateTime value, ValueBridgeFromIndexedValueContext context) Transform the given indexed field value to the corresponding POJO-extracted value.protected final CalendarfromString(String value) booleanisCompatibleWith(IdentifierBridge<?> other) booleanisCompatibleWith(ValueBridge<?, ?> other) final ZonedDateTimeParse an input String to the raw index field value.parseIdentifierLiteral(String value) Transform the given document identifier string value back to the value of the POJO property.protected ZonedDateTimetoConvertedValue(Calendar value) final StringtoDocumentIdentifier(Calendar propertyValue, IdentifierBridgeToDocumentIdentifierContext context) Transform the given POJO property value to the value of the document identifier.final ZonedDateTimetoIndexedValue(Calendar value, ValueBridgeToIndexedValueContext context) Transform the given POJO-extracted value into the value of the indexed field.toString()protected final StringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.bridge.ValueBridge
format
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultJavaUtilCalendarBridge
public DefaultJavaUtilCalendarBridge()
-
-
Method Details
-
toConvertedValue
-
fromConvertedValue
-
toIndexedValue
Description copied from interface:ValueBridgeTransform the given POJO-extracted value into the value of the indexed field.- Parameters:
value- The POJO-extracted value to be transformed.context- A context that can beextendedto a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).- Returns:
- The value of the indexed field.
-
fromIndexedValue
public final Calendar fromIndexedValue(ZonedDateTime value, ValueBridgeFromIndexedValueContext context) Description copied from interface:ValueBridgeTransform the given indexed field value to the corresponding POJO-extracted value.- Parameters:
value- The value of the indexed field to be transformed.context- A context that can beextendedto a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).- Returns:
- The POJO-extracted value.
-
parse
Description copied from interface:ValueBridgeParse an input String to the raw index field value.- Parameters:
value- The value to parse.- Returns:
- The raw index field value.
-
toString
-
fromString
-
toString
-
close
public final void close()Description copied from interface:ValueBridgeClose any resource before the bridge is discarded.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIdentifierBridge<V>- Specified by:
closein interfaceValueBridge<V,F>
-
toDocumentIdentifier
public final String toDocumentIdentifier(Calendar propertyValue, IdentifierBridgeToDocumentIdentifierContext context) Description copied from interface:IdentifierBridgeTransform the given POJO property value to the value of the document identifier.Must return a unique value for each value of
propertyValue- Specified by:
toDocumentIdentifierin interfaceIdentifierBridge<V>- Parameters:
propertyValue- The POJO property value to be transformed.context- A context that can beextendedto a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).- Returns:
- The value of the document identifier.
-
fromDocumentIdentifier
public final Calendar fromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context) Description copied from interface:IdentifierBridgeTransform the given document identifier value back to the value of the POJO property.Must be the exact inverse function of
IdentifierBridge.toDocumentIdentifier(Object, IdentifierBridgeToDocumentIdentifierContext), i.e.object.equals(fromDocumentIdentifier(toDocumentIdentifier(object, sessionContext)))must always be true.- Specified by:
fromDocumentIdentifierin interfaceIdentifierBridge<V>- Parameters:
documentIdentifier- The document identifier value to be transformed.context- A sessionContext that can beextendedto a more useful type, giving access to such things as a Hibernate ORM Session (if using the Hibernate ORM mapper).- Returns:
- The value of the document identifier.
-
parseIdentifierLiteral
Description copied from interface:IdentifierBridgeTransform the given document identifier string value back to the value of the POJO property.- Specified by:
parseIdentifierLiteralin interfaceIdentifierBridge<V>- Parameters:
value- The value to parse.- Returns:
- The raw index field value.
-
isCompatibleWith
- Specified by:
isCompatibleWithin interfaceIdentifierBridge<V>
-
isCompatibleWith
- Specified by:
isCompatibleWithin interfaceValueBridge<V,F> - Parameters:
other- AnotherValueBridge, nevernull.- Returns:
trueif the given object is also aValueBridgethat behaves exactly the same as this object, i.e. itsValueBridge.toIndexedValue(Object, ValueBridgeToIndexedValueContext)method is guaranteed to accept the same values as this object's and to always return the same value as this object's when given the same input.falseotherwise, or when in doubt.
-