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 TypeMethodDescriptiondefault Objectdeserialize(jakarta.jms.Message message) Extract the body of the message into a sensible type.default <T> Tdeserialize(jakarta.jms.Message message, io.micronaut.core.type.Argument<T> argument) Extract the body of the message into the specified type.<T> Tdeserialize(jakarta.jms.Message message, Class<T> clazz) Extract the body of the message into the specified type.
-
Method Details
-
deserialize
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 usesTypeInformation.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 messageargument- the argument- Returns:
- the extracted message body as an instance of the specified type
- Since:
- 5.2.0
-
deserialize
Extract the body of the message into the specified type.- Type Parameters:
T- the type- Parameters:
message- the messageclazz- the type- Returns:
- the extracted message body as an instance of the specified type
-