public static class ExtendedSerializer.Wrapper<T> extends Object implements ExtendedSerializer<T>
ExtendedSerializer.Wrapper<T>
Constructor and Description |
---|
Wrapper(Serializer<T> serializer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this serializer.
|
void |
configure(Map<String,?> configs,
boolean isKey)
Configure this class.
|
static <T> ExtendedSerializer<T> |
ensureExtended(Serializer<T> serializer) |
byte[] |
serialize(String topic,
Headers headers,
T data)
Convert
data into a byte array. |
byte[] |
serialize(String topic,
T data)
Convert
data into a byte array. |
public Wrapper(Serializer<T> serializer)
public byte[] serialize(String topic, Headers headers, T data)
ExtendedSerializer
data
into a byte array.serialize
in interface ExtendedSerializer<T>
serialize
in interface Serializer<T>
topic
- topic associated with dataheaders
- headers associated with the recorddata
- typed datapublic void configure(Map<String,?> configs, boolean isKey)
Serializer
configure
in interface Serializer<T>
configs
- configs in key/value pairsisKey
- whether is for key or valuepublic byte[] serialize(String topic, T data)
Serializer
data
into a byte array.serialize
in interface Serializer<T>
topic
- topic associated with datadata
- typed datapublic void close()
Serializer
This method must be idempotent as it may be called multiple times.
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Serializer<T>
public static <T> ExtendedSerializer<T> ensureExtended(Serializer<T> serializer)