org.hibernate.search.bridge.builtin
Class DateBridge
java.lang.Object
org.hibernate.search.bridge.builtin.DateBridge
- All Implemented Interfaces:
- ParameterizedBridge, StringBridge, TwoWayStringBridge
public class DateBridge
- extends java.lang.Object
- implements TwoWayStringBridge, ParameterizedBridge
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
- Author:
- Emmanuel Bernard
Method Summary |
java.lang.String |
objectToString(java.lang.Object object)
Converts the object representation to a string. |
void |
setParameterValues(java.util.Map parameters)
|
java.lang.Object |
stringToObject(java.lang.String stringValue)
Convert the index string representation to an object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATE_YEAR
public static final TwoWayStringBridge DATE_YEAR
DATE_MONTH
public static final TwoWayStringBridge DATE_MONTH
DATE_DAY
public static final TwoWayStringBridge DATE_DAY
DATE_HOUR
public static final TwoWayStringBridge DATE_HOUR
DATE_MINUTE
public static final TwoWayStringBridge DATE_MINUTE
DATE_SECOND
public static final TwoWayStringBridge DATE_SECOND
DATE_MILLISECOND
public static final TwoWayStringBridge DATE_MILLISECOND
DateBridge
public DateBridge()
DateBridge
public DateBridge(Resolution resolution)
stringToObject
public java.lang.Object stringToObject(java.lang.String stringValue)
- Description copied from interface:
TwoWayStringBridge
- Convert the index string representation to an object.
- Specified by:
stringToObject
in interface TwoWayStringBridge
- Parameters:
stringValue
- The index value.
- Returns:
- Takes the string representation from the Lucene index and transforms it back into the original
Object
.
objectToString
public java.lang.String objectToString(java.lang.Object object)
- Description copied from interface:
StringBridge
- Converts the object representation to a string.
- Specified by:
objectToString
in interface StringBridge
- 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
public void setParameterValues(java.util.Map parameters)
- Specified by:
setParameterValues
in interface ParameterizedBridge
Copyright © 2006-2010 Hibernate. All Rights Reserved.