Package org.opensearch.client.json
Interface JsonData
-
- All Superinterfaces:
JsonpSerializable
@JsonpDeserializable public interface JsonData extends JsonpSerializable
A raw JSON value. It can be converted to a JSON node tree or to an arbitrary object using aJsonpMapper.This type is used in API types for values that don't have a statically-defined type or that cannot be represented as a generic parameter of the enclosing data structure.
Instances of this class returned by API clients keep a reference to the client's
JsonpMapperand can be converted to arbitrary types usingto(Class)without requiring an explicit mapper.
-
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<JsonData>_DESERIALIZER
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tdeserialize(JsonpDeserializer<T> deserializer)Converts this object using a deserializer.<T> Tdeserialize(JsonpDeserializer<T> deserializer, JsonpMapper mapper)Converts this object using a deserializer.static JsonDatafrom(jakarta.json.stream.JsonParser parser, JsonpMapper mapper)Creates a raw JSON value from a parser.static <T> JsonDataof(T value)Creates a raw JSON value from an existing object.static <T> JsonDataof(T value, JsonpMapper mapper)Creates a raw JSON value from an existing object, along with the mapper to use for further conversions.<T> Tto(java.lang.Class<T> clazz)Converts this object to a target class.<T> Tto(java.lang.Class<T> clazz, JsonpMapper mapper)Converts this object to a target class.jakarta.json.JsonValuetoJson()Converts this object to a JSON node tree.jakarta.json.JsonValuetoJson(JsonpMapper mapper)Converts this object to a JSON node tree.-
Methods inherited from interface org.opensearch.client.json.JsonpSerializable
serialize
-
-
-
-
Field Detail
-
_DESERIALIZER
static final JsonpDeserializer<JsonData> _DESERIALIZER
-
-
Method Detail
-
toJson
jakarta.json.JsonValue toJson()
Converts this object to a JSON node tree. A mapper must have been provided at creation time.- Throws:
java.lang.IllegalStateException- if no mapper was provided at creation time.
-
toJson
jakarta.json.JsonValue toJson(JsonpMapper mapper)
Converts this object to a JSON node tree.
-
to
<T> T to(java.lang.Class<T> clazz)
Converts this object to a target class. A mapper must have been provided at creation time.- Throws:
java.lang.IllegalStateException- if no mapper was provided at creation time.
-
to
<T> T to(java.lang.Class<T> clazz, JsonpMapper mapper)Converts this object to a target class.
-
deserialize
<T> T deserialize(JsonpDeserializer<T> deserializer)
Converts this object using a deserializer. A mapper must have been provided at creation time.- Throws:
java.lang.IllegalStateException- if no mapper was provided at creation time.
-
deserialize
<T> T deserialize(JsonpDeserializer<T> deserializer, JsonpMapper mapper)
Converts this object using a deserializer.
-
of
static <T> JsonData of(T value)
Creates a raw JSON value from an existing object. A mapper will be needed to convert the result.
-
of
static <T> JsonData of(T value, JsonpMapper mapper)
Creates a raw JSON value from an existing object, along with the mapper to use for further conversions.
-
from
static JsonData from(jakarta.json.stream.JsonParser parser, JsonpMapper mapper)
Creates a raw JSON value from a parser. The provider mapper will be used for conversions unless one is explicitly provided usingto(Class, JsonpMapper),toJson(JsonpMapper)ordeserialize(JsonpDeserializer).
-
-