Package com.solace.serdes
Interface Serializer<T>
-
- Type Parameters:
T
- Generic type argument for the input object onserialize(String, Object, Map)
orserialize(String, Object)
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
StringSerializer
public interface Serializer<T> extends Closeable
Interface to convert pojo objects into serialized payload bytes.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Closes thisSerializer
default void
configure(Map<String,?> properties)
Configures thisSerializer
byte[]
serialize(String destinationName, T object)
Serializes given object and destination.default byte[]
serialize(String destinationName, T object, Map<String,Object> headers)
Serializes given object, destination and headers.
-
-
-
Method Detail
-
configure
default void configure(Map<String,?> properties)
Configures thisSerializer
- Parameters:
properties
- the configuration properties- Since:
- 1.0
-
close
default void close() throws IOException
Closes thisSerializer
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- Since:
- 1.0
-
serialize
byte[] serialize(String destinationName, T object)
Serializes given object and destination. This is equivalent to invokingserialize(String, Object, Map)
with null headers.- Parameters:
destinationName
- The topic or queue name to route the object.object
- Business object to serialize.- Returns:
- byte[] from object that will be added as carrier payload
- Since:
- 1.0
-
serialize
default byte[] serialize(String destinationName, T object, Map<String,Object> headers)
Serializes given object, destination and headers.- Parameters:
destinationName
- The topic or queue name to route the object.object
- Business object to serialize.headers
- Defines additional header to not include in the returned bytes, this can be an in/out parameter and can be modified on call to serialize if present.- Returns:
- byte[] from object that will be added as carrier payload
- Since:
- 1.0
-
-