Class ChangedSerializer<T>
- java.lang.Object
-
- org.apache.kafka.streams.kstream.internals.ChangedSerializer<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Serializer<Change<T>>
,WrappingNullableSerializer<Change<T>,Void,T>
public class ChangedSerializer<T> extends Object implements Serializer<Change<T>>, WrappingNullableSerializer<Change<T>,Void,T>
-
-
Constructor Summary
Constructors Constructor Description ChangedSerializer(Serializer<T> inner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this serializer.Serializer<T>
inner()
byte[]
serialize(String topic, Headers headers, Change<T> data)
Convertdata
into a byte array.byte[]
serialize(String topic, Change<T> data)
Convertdata
into a byte array.void
setIfUnset(Serializer<Void> defaultKeySerializer, Serializer<T> defaultValueSerializer)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.kafka.common.serialization.Serializer
configure
-
-
-
-
Constructor Detail
-
ChangedSerializer
public ChangedSerializer(Serializer<T> inner)
-
-
Method Detail
-
inner
public Serializer<T> inner()
-
setIfUnset
public void setIfUnset(Serializer<Void> defaultKeySerializer, Serializer<T> defaultValueSerializer)
- Specified by:
setIfUnset
in interfaceWrappingNullableSerializer<Change<T>,Void,T>
-
serialize
public byte[] serialize(String topic, Headers headers, Change<T> data)
Description copied from interface:Serializer
Convertdata
into a byte array.- Specified by:
serialize
in interfaceSerializer<T>
- Parameters:
topic
- topic associated with dataheaders
- headers associated with the recorddata
- typed data- Returns:
- serialized bytes
- Throws:
StreamsException
- if both old and new values of data are null, or if both values are not null
-
serialize
public byte[] serialize(String topic, Change<T> data)
Description copied from interface:Serializer
Convertdata
into a byte array.- Specified by:
serialize
in interfaceSerializer<T>
- Parameters:
topic
- topic associated with datadata
- typed data- Returns:
- serialized bytes
-
close
public void close()
Description copied from interface:Serializer
Close this serializer.This method must be idempotent as it may be called multiple times.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSerializer<T>
-
-