@Singleton public class JsonMqttPayloadSerDes extends java.lang.Object implements MqttPayloadSerDes<java.lang.Object>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Integer |
ORDER
The order of this serDes.
|
| Constructor and Description |
|---|
JsonMqttPayloadSerDes(io.micronaut.json.JsonMapper jsonMapper)
Default constructor.
|
JsonMqttPayloadSerDes(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Deprecated.
Use
JsonMqttPayloadSerDes(JsonMapper) instead |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
deserialize(byte[] payload,
io.micronaut.core.type.Argument<java.lang.Object> type)
Deserializes the message into the requested type.
|
int |
getOrder() |
byte[] |
serialize(java.lang.Object data)
Serializes the data into a byte[] to be published
to MQTT.
|
boolean |
supports(io.micronaut.core.type.Argument<java.lang.Object> argument)
Determines if this serdes supports the given type.
|
@Deprecated public JsonMqttPayloadSerDes(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
JsonMqttPayloadSerDes(JsonMapper) insteadobjectMapper - The jackson object mapper@Inject public JsonMqttPayloadSerDes(io.micronaut.json.JsonMapper jsonMapper)
jsonMapper - The json mapperpublic java.lang.Object deserialize(byte[] payload,
io.micronaut.core.type.Argument<java.lang.Object> type)
MqttPayloadSerDesdeserialize in interface MqttPayloadSerDes<java.lang.Object>payload - The message to deserializetype - The type to be returnedpublic byte[] serialize(java.lang.Object data)
MqttPayloadSerDesserialize in interface MqttPayloadSerDes<java.lang.Object>data - The data to serializepublic int getOrder()
getOrder in interface io.micronaut.core.order.Orderedpublic boolean supports(io.micronaut.core.type.Argument<java.lang.Object> argument)
MqttPayloadSerDessupports in interface MqttPayloadSerDes<java.lang.Object>argument - The type