Class DefaultYearBridge
java.lang.Object
org.hibernate.search.mapper.pojo.bridge.builtin.impl.DefaultYearBridge
- All Implemented Interfaces:
AutoCloseable,IdentifierBridge<Year>,ValueBridge<Year,Year>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Close any resource before the bridge is discarded.final YearfromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context) Transform the given document identifier value back to the value of the POJO property.final YearfromIndexedValue(Year value, ValueBridgeFromIndexedValueContext context) Transform the given indexed field value to the corresponding POJO-extracted value.protected YearfromString(String value) booleanisCompatibleWith(IdentifierBridge<?> other) booleanisCompatibleWith(ValueBridge<?, ?> other) final YearParse 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.final StringtoDocumentIdentifier(Year propertyValue, IdentifierBridgeToDocumentIdentifierContext context) Transform the given POJO property value to the value of the document identifier.final YeartoIndexedValue(Year value, ValueBridgeToIndexedValueContext context) Transform the given POJO-extracted value into the value of the indexed field.toString()protected 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
-
-
Method Details
-
toString
-
fromString
-
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
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
-
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(Year 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 Year 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.
-