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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectPath
createFromResponse
(Response response) static ObjectPath
createFromXContent
(org.elasticsearch.xcontent.XContent xContent, BytesReference input) static <T> T
A utility method that creates anObjectPath
viaObjectPath(Object)
returns the result of callingevaluate(String)
on it.<T> T
Returns the object corresponding to the provided path if present, null otherwise<T> T
Returns the object corresponding to the provided path if present, null otherwisetoString()
org.elasticsearch.xcontent.XContentBuilder
toXContentBuilder
(org.elasticsearch.xcontent.XContent xContent) Create a newXContentBuilder
from 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 anObjectPath
viaObjectPath(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 newXContentBuilder
from the xContent object underlying thisObjectPath
. This only works forObjectPath
instances created from an xContent object, not from nested substructures. We throw anUnsupportedOperationException
in those cases.- Throws:
IOException
-
toString
-