@Singleton public class JavaLangRabbitMessageSerDes extends java.lang.Object implements RabbitMessageSerDes<java.lang.Object>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<RabbitMessageSerDes> |
javaSerDes |
static java.lang.Integer |
ORDER
The order of this serDes.
|
Constructor and Description |
---|
JavaLangRabbitMessageSerDes()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(RabbitConsumerState messageState,
io.micronaut.core.type.Argument<java.lang.Object> argument)
Deserializes the message into the requested type.
|
protected RabbitMessageSerDes |
findSerDes(io.micronaut.core.type.Argument<?> type)
Finds the correct serDes based on the type.
|
protected RabbitMessageSerDes<java.lang.Boolean> |
getBooleanSerDes() |
protected RabbitMessageSerDes<byte[]> |
getByteArraySerDes() |
protected RabbitMessageSerDes<java.nio.ByteBuffer> |
getByteBufferSerDes() |
protected RabbitMessageSerDes<java.lang.Double> |
getDoubleSerDes() |
protected RabbitMessageSerDes<java.lang.Float> |
getFloatSerDes() |
protected RabbitMessageSerDes<java.lang.Integer> |
getIntegerSerDes() |
protected RabbitMessageSerDes<java.lang.Long> |
getLongSerDes() |
int |
getOrder() |
protected RabbitMessageSerDes<java.lang.Short> |
getShortSerDes() |
protected RabbitMessageSerDes<java.lang.String> |
getStringSerDes() |
protected RabbitMessageSerDes<java.util.UUID> |
getUUIDSerDes() |
byte[] |
serialize(java.lang.Object data,
MutableBasicProperties properties)
Serializes the data into a byte[] to be published
to RabbitMQ.
|
boolean |
supports(io.micronaut.core.type.Argument<java.lang.Object> argument)
Determines if this serdes supports the given type.
|
public static final java.lang.Integer ORDER
protected final java.util.List<RabbitMessageSerDes> javaSerDes
public JavaLangRabbitMessageSerDes()
public byte[] serialize(@Nullable java.lang.Object data, MutableBasicProperties properties)
RabbitMessageSerDes
serialize
in interface RabbitMessageSerDes<java.lang.Object>
data
- The data to serializeproperties
- The properties of the messagepublic java.lang.Object deserialize(RabbitConsumerState messageState, io.micronaut.core.type.Argument<java.lang.Object> argument)
RabbitMessageSerDes
deserialize
in interface RabbitMessageSerDes<java.lang.Object>
messageState
- The message to deserializeargument
- The type to be returnedpublic boolean supports(io.micronaut.core.type.Argument<java.lang.Object> argument)
RabbitMessageSerDes
supports
in interface RabbitMessageSerDes<java.lang.Object>
argument
- The typepublic int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
@Nullable protected RabbitMessageSerDes findSerDes(io.micronaut.core.type.Argument<?> type)
type
- The java type@NonNull protected RabbitMessageSerDes<java.lang.String> getStringSerDes()
String
@NonNull protected RabbitMessageSerDes<java.lang.Short> getShortSerDes()
Short
@NonNull protected RabbitMessageSerDes<java.lang.Integer> getIntegerSerDes()
Integer
@NonNull protected RabbitMessageSerDes<java.lang.Long> getLongSerDes()
Long
@NonNull protected RabbitMessageSerDes<java.lang.Float> getFloatSerDes()
Float
@NonNull protected RabbitMessageSerDes<java.lang.Double> getDoubleSerDes()
Double
@NonNull protected RabbitMessageSerDes<byte[]> getByteArraySerDes()
@NonNull protected RabbitMessageSerDes<java.nio.ByteBuffer> getByteBufferSerDes()
ByteBuffer
@NonNull protected RabbitMessageSerDes<java.util.UUID> getUUIDSerDes()
UUID
@NonNull protected RabbitMessageSerDes<java.lang.Boolean> getBooleanSerDes()
UUID