Package io.micronaut.gcp.pubsub.serdes
Class JavaMessageSerDes
- java.lang.Object
-
- io.micronaut.gcp.pubsub.serdes.JavaMessageSerDes
-
- All Implemented Interfaces:
PubSubMessageSerDes
@Singleton public class JavaMessageSerDes extends java.lang.Object implements PubSubMessageSerDes
-
-
Constructor Summary
Constructors Constructor Description JavaMessageSerDes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
deserialize(byte[] data, io.micronaut.core.type.Argument<?> type)
Deserializes data into a target type.byte[]
serialize(java.lang.Object data)
Serializes the message.java.lang.String
supportedType()
-
-
-
Method Detail
-
supportedType
public java.lang.String supportedType()
- Specified by:
supportedType
in interfacePubSubMessageSerDes
- Returns:
- The supported mime type this SerDes is capable of hanlding
-
deserialize
public java.lang.Object deserialize(byte[] data, io.micronaut.core.type.Argument<?> type)
Description copied from interface:PubSubMessageSerDes
Deserializes data into a target type.- Specified by:
deserialize
in interfacePubSubMessageSerDes
- Parameters:
data
- byte data to deserializetype
- target type- Returns:
- the deserialized java type
-
serialize
public byte[] serialize(java.lang.Object data)
Description copied from interface:PubSubMessageSerDes
Serializes the message.- Specified by:
serialize
in interfacePubSubMessageSerDes
- Parameters:
data
- data to serialize- Returns:
- byte array of serialized data
-
-