public static class ExtendedSerializer.Wrapper<T> extends java.lang.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(java.util.Map<java.lang.String,?> configs,
boolean isKey)
Configure this class.
|
static <T> ExtendedSerializer<T> |
ensureExtended(Serializer<T> serializer) |
byte[] |
serialize(java.lang.String topic,
Headers headers,
T data)
Convert
data into a byte array. |
byte[] |
serialize(java.lang.String topic,
T data)
Convert
data into a byte array. |
public Wrapper(Serializer<T> serializer)
public byte[] serialize(java.lang.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(java.util.Map<java.lang.String,?> configs, boolean isKey)
Serializer
configure
in interface Serializer<T>
configs
- configs in key/value pairsisKey
- whether is for key or valuepublic byte[] serialize(java.lang.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
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Serializer<T>
public static <T> ExtendedSerializer<T> ensureExtended(Serializer<T> serializer)