public class FieldDefinition extends Object implements SchemaDefinition
Modifier and Type | Field and Description |
---|---|
protected boolean |
_docValues
If the field is stored as docValues.
|
protected boolean |
_indexed
Whether the field is indexed.
|
protected boolean |
_multiValued
If the field is multi-valued.
|
protected String |
_name
The field name, can contain a star character to represent a dynamic field (i.e.
|
protected boolean |
_stored
Whether the field is stored.
|
protected String |
_type
The field type.
|
Constructor and Description |
---|
FieldDefinition(Map<String,Object> attributes)
Build a field definition from a map of attributes.
|
FieldDefinition(String name,
String type,
boolean multiValued,
boolean docValues)
Build a field definition, indexed and stored.
|
FieldDefinition(String name,
String type,
boolean multiValued,
boolean docValues,
boolean indexed,
boolean stored)
Build a field definition.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
getBoolean(Map<String,Object> attributes,
String name,
boolean defaultValue) |
String |
getName()
Get the field name.
|
String |
getType()
Get the field type.
|
boolean |
isDocValues()
True to store the field as docValues.
|
boolean |
isDynamic()
Test if the field is dynamic.
|
boolean |
isIndexed()
True to store the field as indexed.
|
boolean |
isMultiValued()
If the field is multi-valued.
|
boolean |
isStored()
True to store the field as stored.
|
void |
setDocValues(boolean docValues)
Set if the field is stored as docValues.
|
void |
setIndexed(boolean indexed)
Set if the field is stored as indexed.
|
void |
setMultiValued(boolean multiValued)
Set if the field is multi-valued.
|
void |
setName(String name)
Set the field name.
|
void |
setStored(boolean stored)
Set if the field is stored as stored.
|
void |
setType(String type)
Set the field type.
|
protected String _name
protected boolean _multiValued
protected boolean _docValues
protected boolean _indexed
protected boolean _stored
public FieldDefinition(String name, String type, boolean multiValued, boolean docValues)
name
- The field name, can contain a star character to represent a dynamic field (i.e. *_type).type
- The field type.multiValued
- true
if the field is multi-valued.docValues
- true
if the field is stored as docValues.public FieldDefinition(String name, String type, boolean multiValued, boolean docValues, boolean indexed, boolean stored)
name
- The field name, can contain a star character to represent a dynamic field (i.e. *_type).type
- The field type.multiValued
- true
if the field is multi-valued.docValues
- true
if the field is stored as docValues.indexed
- true
if the field is indexed.stored
- true
if the field is stored.public FieldDefinition(Map<String,Object> attributes)
attributes
- the Map of attributes.private boolean getBoolean(Map<String,Object> attributes, String name, boolean defaultValue)
public boolean isMultiValued()
public void setMultiValued(boolean multiValued)
multiValued
- true
if the field is multi-valued.public boolean isDocValues()
public void setDocValues(boolean docValues)
docValues
- true
if the field is stored as docValues.public boolean isIndexed()
public void setIndexed(boolean indexed)
indexed
- true
if the field is stored as indexed.public boolean isStored()
public void setStored(boolean stored)
stored
- true
if the field is stored as stored.public boolean isDynamic()