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