Class DateBridge
java.lang.Object
org.hibernate.search.bridge.builtin.DateBridge
- All Implemented Interfaces:
ParameterizedBridge,StringBridge,TwoWayStringBridge
Bridge a java.util.Date to a String, truncated to the resolution
Date are stored GMT based
ie
Resolution.YEAR: yyyy
Resolution.MONTH: yyyyMM
Resolution.DAY: yyyyMMdd
Resolution.HOUR: yyyyMMddHH
Resolution.MINUTE: yyyyMMddHHmm
Resolution.SECOND: yyyyMMddHHmmss
Resolution.MILLISECOND: yyyyMMddHHmmssSSS
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TwoWayStringBridgestatic final TwoWayStringBridgestatic final TwoWayStringBridgestatic final TwoWayStringBridgestatic final TwoWayStringBridgestatic final TwoWayStringBridgestatic final TwoWayStringBridge -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionobjectToString(Object object) Converts the object representation to a string.voidsetParameterValues(Map parameters) stringToObject(String stringValue) Convert the index string representation to an object.
-
Field Details
-
DATE_YEAR
-
DATE_MONTH
-
DATE_DAY
-
DATE_HOUR
-
DATE_MINUTE
-
DATE_SECOND
-
DATE_MILLISECOND
-
-
Constructor Details
-
DateBridge
public DateBridge() -
DateBridge
-
-
Method Details
-
stringToObject
Description copied from interface:TwoWayStringBridgeConvert the index string representation to an object.- Specified by:
stringToObjectin interfaceTwoWayStringBridge- Parameters:
stringValue- The index value.- Returns:
- Takes the string representation from the Lucene index and transforms it back into the original
Object.
-
objectToString
Description copied from interface:StringBridgeConverts the object representation to a string.- Specified by:
objectToStringin interfaceStringBridge- Parameters:
object- The object to transform into a string representation.- Returns:
- String representation of the given object to be stored in Lucene index. The return string must not be
null. It can be empty though.
-
setParameterValues
- Specified by:
setParameterValuesin interfaceParameterizedBridge
-