Package org.elasticsearch.client.common
Class XContentSource
java.lang.Object
org.elasticsearch.client.common.XContentSource
public class XContentSource
extends java.lang.Object
Encapsulates the xcontent source
-
Constructor Summary
Constructors Constructor Description XContentSource(XContentParser parser)
Constructs a new XContentSource out of the given parser -
Method Summary
-
Constructor Details
-
XContentSource
Constructs a new XContentSource out of the given parser- Throws:
java.io.IOException
-
-
Method Details
-
isMap
public boolean isMap()- Returns:
- true if the top level value of the source is a map
-
getAsMap
public java.util.Map<java.lang.String,java.lang.Object> getAsMap()- Returns:
- The source as a map
-
isList
public boolean isList()- Returns:
- true if the top level value of the source is a list
-
getAsList
public java.util.List<java.lang.Object> getAsList()- Returns:
- The source as a list
-
getValue
public <T> T getValue(java.lang.String path)Extracts a value identified by the given path in the source.- Parameters:
path
- a dot notation path to the requested value- Returns:
- The extracted value or
null
if no value is associated with the given path
-