Package org.elasticsearch.test.rest.yaml
Class ObjectPath
java.lang.Object
org.elasticsearch.test.rest.yaml.ObjectPath
Holds an object and allows to extract specific values from it given their path
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectPathcreateFromResponse(org.elasticsearch.client.Response response)static ObjectPathcreateFromXContent(org.elasticsearch.common.xcontent.XContent xContent, org.elasticsearch.common.bytes.BytesReference input)static <T> TA utility method that creates anObjectPathviaObjectPath(Object)returns the result of callingevaluate(String)on it.<T> TReturns the object corresponding to the provided path if present, null otherwise<T> TReturns the object corresponding to the provided path if present, null otherwiseorg.elasticsearch.common.xcontent.XContentBuildertoXContentBuilder(org.elasticsearch.common.xcontent.XContent xContent)Create a newXContentBuilderfrom the xContent object underlying thisObjectPath.
-
Constructor Details
-
ObjectPath
-
-
Method Details
-
createFromResponse
public static ObjectPath createFromResponse(org.elasticsearch.client.Response response) throws IOException- Throws:
IOException
-
createFromXContent
public static ObjectPath createFromXContent(org.elasticsearch.common.xcontent.XContent xContent, org.elasticsearch.common.bytes.BytesReference input) throws IOException- Throws:
IOException
-
evaluate
A utility method that creates anObjectPathviaObjectPath(Object)returns the result of callingevaluate(String)on it.- Throws:
IOException
-
evaluate
Returns the object corresponding to the provided path if present, null otherwise- Throws:
IOException
-
evaluate
Returns the object corresponding to the provided path if present, null otherwise- Throws:
IOException
-
toXContentBuilder
public org.elasticsearch.common.xcontent.XContentBuilder toXContentBuilder(org.elasticsearch.common.xcontent.XContent xContent) throws IOExceptionCreate a newXContentBuilderfrom the xContent object underlying thisObjectPath. This only works forObjectPathinstances created from an xContent object, not from nested substructures. We throw anUnsupportedOperationExceptionin those cases.- Throws:
IOException
-