Package io.micronaut.nats.serdes
Class JsonNatsMessageSerDes
java.lang.Object
io.micronaut.nats.serdes.JsonNatsMessageSerDes
- All Implemented Interfaces:
- io.micronaut.core.order.Ordered,- NatsMessageSerDes<Object>
Serializes and deserializes objects as JSON using Jackson.
- Since:
- 1.0.0
- Author:
- jgrimm
- 
Field SummaryFieldsFields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionJsonNatsMessageSerDes(io.micronaut.json.JsonMapper jsonMapper) Default constructor.
- 
Method SummaryModifier and TypeMethodDescription@Nullable Objectdeserialize(io.nats.client.Message message, io.micronaut.core.type.Argument<Object> type) Deserializes the message into the requested type.intgetOrder()byte[]Serializes the data into a byte[] to be published to nats.booleanDetermines if this serdes supports the given type.
- 
Field Details- 
ORDERThe order of this serDes.
 
- 
- 
Constructor Details- 
JsonNatsMessageSerDes@Inject public JsonNatsMessageSerDes(io.micronaut.json.JsonMapper jsonMapper) Default constructor.- Parameters:
- jsonMapper- The json mapper
- Since:
- 3.1.0
 
 
- 
- 
Method Details- 
deserialize@Nullable public @Nullable Object deserialize(io.nats.client.Message message, io.micronaut.core.type.Argument<Object> type) Description copied from interface:NatsMessageSerDesDeserializes the message into the requested type.- Specified by:
- deserializein interface- NatsMessageSerDes<Object>
- Parameters:
- message- The message to deserialize
- type- The type to be returned
- Returns:
- The deserialized body
 
- 
serializeDescription copied from interface:NatsMessageSerDesSerializes the data into a byte[] to be published to nats.- Specified by:
- serializein interface- NatsMessageSerDes<Object>
- Parameters:
- data- The data to serialize
- Returns:
- The message body
 
- 
getOrderpublic int getOrder()- Specified by:
- getOrderin interface- io.micronaut.core.order.Ordered
 
- 
supportsDescription copied from interface:NatsMessageSerDesDetermines if this serdes supports the given type.- Specified by:
- supportsin interface- NatsMessageSerDes<Object>
- Parameters:
- argument- The type
- Returns:
- True if the type is supported
 
 
-