Interface Deserializer

All Known Implementing Classes:
DefaultSerializerDeserializer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @DefaultImplementation(DefaultSerializerDeserializer.class) public interface Deserializer
Extracts a Message body to an instance of the specified type.
Since:
1.0.0
Author:
Elliott Pope
  • Method Summary

    Modifier and Type
    Method
    Description
    default Object
    deserialize(jakarta.jms.Message message)
    Extract the body of the message into a sensible type.
    default <T> T
    deserialize(jakarta.jms.Message message, io.micronaut.core.type.Argument<T> argument)
    Extract the body of the message into the specified type.
    <T> T
    deserialize(jakarta.jms.Message message, Class<T> clazz)
    Extract the body of the message into the specified type.
  • Method Details

    • deserialize

      default Object deserialize(jakarta.jms.Message message)
      Extract the body of the message into a sensible type.
      Parameters:
      message - the message
      Returns:
      the extracted message body as an instance of a sensible type
    • deserialize

      default <T> T deserialize(jakarta.jms.Message message, io.micronaut.core.type.Argument<T> argument)
      Extract the body of the message into the specified type.

      The default implementation delegates to deserialize(Message, Class) and only uses TypeInformation.getType(), so it does not preserve type variables. Implementers should override this method to support generic-aware deserialization.

      Type Parameters:
      T - the type
      Parameters:
      message - the message
      argument - the argument
      Returns:
      the extracted message body as an instance of the specified type
      Since:
      5.2.0
    • deserialize

      <T> T deserialize(jakarta.jms.Message message, Class<T> clazz)
      Extract the body of the message into the specified type.
      Type Parameters:
      T - the type
      Parameters:
      message - the message
      clazz - the type
      Returns:
      the extracted message body as an instance of the specified type