public class StringEncodingCalendarBridge extends StringEncodingDateBridge
java.util.Calendar to a String, truncated to the specified resolution.
| Modifier and Type | Field and Description |
|---|---|
static TwoWayFieldBridge |
CALENDAR_DAY |
static TwoWayFieldBridge |
CALENDAR_HOUR |
static TwoWayFieldBridge |
CALENDAR_MILLISECOND |
static TwoWayFieldBridge |
CALENDAR_MINUTE |
static TwoWayFieldBridge |
CALENDAR_MONTH |
static TwoWayFieldBridge |
CALENDAR_SECOND |
static TwoWayFieldBridge |
CALENDAR_YEAR |
DATE_DAY, DATE_HOUR, DATE_MILLISECOND, DATE_MINUTE, DATE_MONTH, DATE_SECOND, DATE_YEAR| Constructor and Description |
|---|
StringEncodingCalendarBridge() |
StringEncodingCalendarBridge(Resolution resolution) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(String name,
org.apache.lucene.document.Document document)
Build the element object from the
Document |
String |
objectToString(Object object)
Convert the object representation to a string.
|
void |
set(String name,
Object value,
org.apache.lucene.document.Document document,
LuceneOptions luceneOptions)
Manipulate the document to index the given value.
|
setParameterValuespublic static final TwoWayFieldBridge CALENDAR_YEAR
public static final TwoWayFieldBridge CALENDAR_MONTH
public static final TwoWayFieldBridge CALENDAR_DAY
public static final TwoWayFieldBridge CALENDAR_HOUR
public static final TwoWayFieldBridge CALENDAR_MINUTE
public static final TwoWayFieldBridge CALENDAR_SECOND
public static final TwoWayFieldBridge CALENDAR_MILLISECOND
public StringEncodingCalendarBridge()
public StringEncodingCalendarBridge(Resolution resolution)
public Object get(String name, org.apache.lucene.document.Document document)
TwoWayFieldBridgeDocumentget in interface TwoWayFieldBridgeget in class StringEncodingDateBridgename - field namedocument - documentpublic String objectToString(Object object)
TwoWayFieldBridgeobjectToString in interface TwoWayFieldBridgeobjectToString in class StringEncodingDateBridgeobject - The object to index.null, but
can be empty.public void set(String name, Object value, org.apache.lucene.document.Document document, LuceneOptions luceneOptions)
FieldBridge
A common implementation is to add a Field with the given name to document following
the parameters luceneOptions if the value is not null.
String fieldValue = convertToString(value);
luceneOptions.addFieldToDocument(name, fieldValue, document);
set in interface FieldBridgeset in class StringEncodingDateBridgename - The field to add to the Lucene documentvalue - The actual value to indexdocument - The Lucene document into which we want to index the value.luceneOptions - Contains the parameters used for adding value to
the Lucene document.Copyright © 2006–2017 Hibernate. All rights reserved.