public enum NumericFieldBridge extends Enum<NumericFieldBridge> implements FieldBridge, TwoWayFieldBridge
Enum Constant and Description |
---|
BYTE_FIELD_BRIDGE
Persists byte properties in int index fields.
|
DOUBLE_FIELD_BRIDGE
Persists double properties in double index fields.
|
FLOAT_FIELD_BRIDGE
Persists float properties in float index fields.
|
INT_FIELD_BRIDGE
Persists int properties in int index fields.
|
LONG_FIELD_BRIDGE
Persists long properties in long index fields.
|
SHORT_FIELD_BRIDGE
Persists short properties in int index fields.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyToLuceneOptions(LuceneOptions luceneOptions,
String name,
Number value,
Document document) |
Object |
get(String name,
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,
Document document,
LuceneOptions luceneOptions)
Manipulate the document to index the given value.
|
static NumericFieldBridge |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NumericFieldBridge[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NumericFieldBridge BYTE_FIELD_BRIDGE
public static final NumericFieldBridge SHORT_FIELD_BRIDGE
public static final NumericFieldBridge INT_FIELD_BRIDGE
public static final NumericFieldBridge FLOAT_FIELD_BRIDGE
public static final NumericFieldBridge DOUBLE_FIELD_BRIDGE
public static final NumericFieldBridge LONG_FIELD_BRIDGE
public static NumericFieldBridge[] values()
for (NumericFieldBridge c : NumericFieldBridge.values()) System.out.println(c);
public static NumericFieldBridge valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void set(String name, Object value, 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 FieldBridge
name
- 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.public final String objectToString(Object object)
TwoWayFieldBridge
objectToString
in interface TwoWayFieldBridge
object
- The object to index.null
, but
can be empty.public Object get(String name, Document document)
TwoWayFieldBridge
Document
get
in interface TwoWayFieldBridge
name
- field namedocument
- documentprotected void applyToLuceneOptions(LuceneOptions luceneOptions, String name, Number value, Document document)
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved