Class DefaultJavaSqlTimestampBridge
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.bridge.builtin.impl.DefaultJavaSqlTimestampBridge
-
- All Implemented Interfaces:
AutoCloseable,IdentifierBridge<Timestamp>,ValueBridge<Timestamp,Instant>
public final class DefaultJavaSqlTimestampBridge extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultJavaSqlTimestampBridgeINSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultJavaSqlTimestampBridge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close any resource before the bridge is discarded.protected TimestampfromConvertedValue(Instant value)VfromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context)Transform the given document identifier value back to the value of the POJO property.VfromIndexedValue(F value, ValueBridgeFromIndexedValueContext context)Transform the given indexed field value to the corresponding POJO-extracted value.protected VfromString(String value)booleanisCompatibleWith(IdentifierBridge<?> other)booleanisCompatibleWith(ValueBridge<?,?> other)Fparse(String value)Parse an input String to the raw index field value.protected InstanttoConvertedValue(Timestamp value)StringtoDocumentIdentifier(V propertyValue, IdentifierBridgeToDocumentIdentifierContext context)Transform the given POJO property value to the value of the document identifier.FtoIndexedValue(V value, ValueBridgeToIndexedValueContext context)Transform the given POJO-extracted value into the value of the indexed field.StringtoString()protected StringtoString(V value)
-
-
-
Field Detail
-
INSTANCE
public static final DefaultJavaSqlTimestampBridge INSTANCE
-
-
Method Detail
-
toIndexedValue
public final F toIndexedValue(V value, ValueBridgeToIndexedValueContext context)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 V fromIndexedValue(F 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
public final F parse(String value)
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
protected final String toString(V value)
-
fromString
protected final V fromString(String value)
-
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(V 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 V 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.
-
isCompatibleWith
public boolean isCompatibleWith(IdentifierBridge<?> other)
- Specified by:
isCompatibleWithin interfaceIdentifierBridge<V>
-
isCompatibleWith
public boolean isCompatibleWith(ValueBridge<?,?> other)
- 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.
-
-