Package org.opensearch.client.json
Class ValueBodyDeserializer<ObjectType>
java.lang.Object
org.opensearch.client.json.JsonpDeserializer<ObjectType>
org.opensearch.client.json.DelegatingDeserializer<ObjectType>
org.opensearch.client.json.ValueBodyDeserializer<ObjectType>
public class ValueBodyDeserializer<ObjectType> extends DelegatingDeserializer<ObjectType>
Deserializer for bodies of type `ValueOf`. It is modelled after
ObjectDeserializer (with an
add method) to fit into the same code generation structure with no additional runtime cost.-
Constructor Summary
Constructors Constructor Description ValueBodyDeserializer(java.util.function.Supplier<ObjectType> constructor) -
Method Summary
Modifier and Type Method Description <FieldType>
voidadd(java.util.function.BiConsumer<ObjectType,FieldType> setter, JsonpDeserializer<FieldType> valueParser, java.lang.String name, java.lang.String... deprecatedNames)ObjectTypedeserialize(jakarta.json.stream.JsonParser parser, JsonpMapper mapper, jakarta.json.stream.JsonParser.Event event)Parse a value.Methods inherited from class org.opensearch.client.json.JsonpDeserializer
acceptedEvents, accepts, allAcceptedEvents, arrayDeserializer, booleanDeserializer, deserialize, doubleDeserializer, ensureAccepts, fixedValue, floatParser, integerDeserializer, jsonValueDeserializer, lazy, lazy, longParser, numberDeserializer, of, stringDeserializer, stringMapDeserializer
-
Constructor Details
-
Method Details
-
deserialize
public ObjectType deserialize(jakarta.json.stream.JsonParser parser, JsonpMapper mapper, jakarta.json.stream.JsonParser.Event event)Description copied from class:JsonpDeserializerParse a value. The value starts at the current state in the json stream. This method will usually start withensureAccepts(parser, event)to ensure correctness of the starting state.- Specified by:
deserializein classJsonpDeserializer<ObjectType>- Parameters:
parser- the json parsermapper- the jsonp mapperevent- the current state ofparser, which must be part ofJsonpDeserializer.acceptedEvents- Returns:
- the parsed value
-
add
public <FieldType> void add(java.util.function.BiConsumer<ObjectType,FieldType> setter, JsonpDeserializer<FieldType> valueParser, java.lang.String name, java.lang.String... deprecatedNames)- Specified by:
addin classDelegatingDeserializer<ObjectType>
-