Interface Serializer<K,V>
- Type Parameters:
K- Key type to be serialized from.A class that implements this interface is expected to have a constructor with no parameter.
- All Superinterfaces:
AutoCloseable,Closeable,org.apache.kafka.common.Configurable,Serializable
- All Known Implementing Classes:
SchemaRegistrySerializer
public interface Serializer<K,V>
extends org.apache.kafka.common.Configurable, Serializable, Closeable
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this serializerdeserializeKey(byte[] key) deserializeValue(K key, byte[] value) byte[]serializeKey(K key) byte[]serializeValue(V value) Methods inherited from interface org.apache.kafka.common.Configurable
configure
-
Method Details
-
serializeKey
- Parameters:
key- Typed key- Returns:
- bytes of the serialized key
- Throws:
SerializationException
-
serializeValue
- Parameters:
value- Typed value- Returns:
- bytes of the serialized value
- Throws:
SerializationException
-
deserializeKey
- Parameters:
key- Bytes of the serialized key- Returns:
- Typed deserialized key
- Throws:
SerializationException
-
deserializeValue
- Parameters:
key- Typed key corresponding to this valuevalue- Bytes of the serialized value- Returns:
- Typed deserialized value
- Throws:
SerializationException
-
close
void close()Close this serializer- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-