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(Response response) static ObjectPathcreateFromXContent(org.elasticsearch.xcontent.XContent xContent, 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 otherwiseintevaluateArraySize(String path) <T> TevaluateExact(String... path) Returns the object corresponding to the provided path if present, null otherwise<T> TevaluateExact(Stash stash, String... path) Returns the object corresponding to the provided path if present, null otherwiseevaluateMapKeys(String path) toString()org.elasticsearch.xcontent.XContentBuildertoXContentBuilder(org.elasticsearch.xcontent.XContent xContent) Create a newXContentBuilderfrom the xContent object underlying thisObjectPath.
-
Constructor Details
-
ObjectPath
-
-
Method Details
-
createFromResponse
- Throws:
IOException
-
createFromXContent
public static ObjectPath createFromXContent(org.elasticsearch.xcontent.XContent xContent, 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
-
evaluateExact
Returns the object corresponding to the provided path if present, null otherwise- Throws:
IOException
-
evaluateExact
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
-
toString
-
evaluateArraySize
- Throws:
IOException
-
evaluateMapKeys
- Throws:
IOException
-