Interface CustomizableDeserializer<T>

Type Parameters:
T - The deserializer type
All Superinterfaces:
Deserializer<T>
All Known Implementing Classes:
ObjectArraySerde, ObjectDeserializer

public interface CustomizableDeserializer<T> extends Deserializer<T>
The type of deserializer that requires a specific implementation by calling Deserializer.createSpecific(DecoderContext, Argument).
Author:
Denis Stepanov
  • Method Details

    • deserialize

      default T deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super T> type) throws IOException
      Description copied from interface: Deserializer
      Deserializes from the current state of the Decoder an object of type Deserializer.
      Specified by:
      deserialize in interface Deserializer<T>
      Parameters:
      decoder - The decoder, never null
      context - The decoder context, never null
      type - The generic type to be deserialized
      Returns:
      The deserialized object or null only if Deserializer.allowNull() returns true
      Throws:
      IOException - If an error occurs during deserialization of the object
    • allowNull

      default boolean allowNull()
      Description copied from interface: Deserializer
      Return true if the decoder can accept the null value by converting it to something else or just returning null.
      Specified by:
      allowNull in interface Deserializer<T>
      Returns:
      Whether the deserializer is allowed to emit null
    • getDefaultValue

      default T getDefaultValue(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super T> type)
      Description copied from interface: Deserializer
      Obtains a default value that can be returned from this deserializer in the case where a value is absent.
      Specified by:
      getDefaultValue in interface Deserializer<T>
      Parameters:
      context - The decoder context, never null
      type - The generic type to be deserialized
      Returns:
      The default value