Class DocumentField
- java.lang.Object
-
- org.elasticsearch.common.document.DocumentField
-
- All Implemented Interfaces:
Iterable<Object>,Writeable,ToXContent,ToXContentFragment
public class DocumentField extends Object implements Writeable, ToXContentFragment, Iterable<Object>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description DocumentField(String name, List<Object> values)DocumentField(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static DocumentFieldfromXContent(XContentParser parser)StringgetName()The name of the field.<V> VgetValue()The first value of the hit.List<Object>getValues()The field values.inthashCode()booleanisMetadataField()Iterator<Object>iterator()StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
DocumentField
public DocumentField(StreamInput in) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getName
public String getName()
The name of the field.
-
getValue
public <V> V getValue()
The first value of the hit.
-
isMetadataField
public boolean isMetadataField()
- Returns:
- The field is a metadata field
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
fromXContent
public static DocumentField fromXContent(XContentParser parser) throws IOException
- Throws:
IOException
-
-