Package org.elasticsearch.client.common
Class XContentSource
java.lang.Object
org.elasticsearch.client.common.XContentSource
Encapsulates the xcontent source
-
Constructor Summary
ConstructorDescriptionXContentSource
(org.elasticsearch.xcontent.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:
IOException
-
-
Method Details
-
isMap
public boolean isMap()- Returns:
- true if the top level value of the source is a map
-
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
- Returns:
- The source as a list
-
getValue
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
-