Package co.elastic.clients.json
Class ValueBodyDeserializer<ObjectType>
java.lang.Object
co.elastic.clients.json.JsonpDeserializer<ObjectType>
co.elastic.clients.json.DelegatingDeserializer<ObjectType>
co.elastic.clients.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.voidsetKey(java.util.function.BiConsumer<ObjectType,java.lang.String> setter)Not supported in this implementationvoidsetTypeProperty(java.lang.String name)Not supported in this implementationMethods inherited from class co.elastic.clients.json.DelegatingDeserializer
ignore, setUnknownFieldHandlerMethods inherited from class co.elastic.clients.json.JsonpDeserializer
acceptedEvents, accepts, allAcceptedEvents, arrayDeserializer, booleanDeserializer, deserialize, doubleDeserializer, emptyObject, ensureAccepts, fixedValue, floatDeserializer, integerDeserializer, jsonValueDeserializer, lazy, lazy, lazy, lazyInstance, longDeserializer, numberDeserializer, of, of, of, stringDeserializer, stringMapDeserializerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ValueBodyDeserializer
-
-
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>
-
setKey
Not supported in this implementation- Specified by:
setKeyin classDelegatingDeserializer<ObjectType>- Parameters:
setter- the key setter- Throws:
java.lang.UnsupportedOperationException- not implemented.
-
setTypeProperty
public void setTypeProperty(java.lang.String name)Not supported in this implementation- Specified by:
setTypePropertyin classDelegatingDeserializer<ObjectType>- Throws:
java.lang.UnsupportedOperationException- not implemented.
-