Package org.elasticsearch.test.rest
Class ObjectPath
java.lang.Object
org.elasticsearch.test.rest.ObjectPath
Holds an object and allows extraction of 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.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.xcontent.XContentBuildertoXContentBuilder(org.elasticsearch.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.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.xcontent.XContentBuilder toXContentBuilder(org.elasticsearch.xcontent.XContent xContent) throws IOException Create 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
-