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 Details

    • ValueBodyDeserializer

      public ValueBodyDeserializer​(java.util.function.Supplier<ObjectType> constructor)
  • Method Details

    • deserialize

      public ObjectType deserialize​(jakarta.json.stream.JsonParser parser, JsonpMapper mapper, jakarta.json.stream.JsonParser.Event event)
      Description copied from class: JsonpDeserializer
      Parse a value. The value starts at the current state in the json stream. This method will usually start with ensureAccepts(parser, event) to ensure correctness of the starting state.
      Specified by:
      deserialize in class JsonpDeserializer<ObjectType>
      Parameters:
      parser - the json parser
      mapper - the jsonp mapper
      event - the current state of parser, which must be part of JsonpDeserializer.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:
      add in class DelegatingDeserializer<ObjectType>
    • setKey

      public void setKey​(java.util.function.BiConsumer<ObjectType,​java.lang.String> setter)
      Not supported in this implementation
      Specified by:
      setKey in class DelegatingDeserializer<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:
      setTypeProperty in class DelegatingDeserializer<ObjectType>
      Throws:
      java.lang.UnsupportedOperationException - not implemented.