Package org.apache.kafka.streams.kstream
Class Serialized<K,V>
- java.lang.Object
-
- org.apache.kafka.streams.kstream.Serialized<K,V>
-
- Type Parameters:
K- the key typeV- the value type
public class Serialized<K,V> extends java.lang.ObjectThe class that is used to capture the key and valueSerdes used when performingKStream.groupBy(KeyValueMapper, Serialized)andKStream.groupByKey(Serialized)operations.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.kafka.common.serialization.Serde<K>keySerdeprotected org.apache.kafka.common.serialization.Serde<V>valueSerde
-
Constructor Summary
Constructors Modifier Constructor Description protectedSerialized(Serialized<K,V> serialized)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
Serialized<K,V>with(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valueSerde)Construct aSerializedinstance with the provided key and valueSerdes.Serialized<K,V>withKeySerde(org.apache.kafka.common.serialization.Serde<K> keySerde)Construct aSerializedinstance with the provided keySerde.Serialized<K,V>withValueSerde(org.apache.kafka.common.serialization.Serde<V> valueSerde)Construct aSerializedinstance with the provided valueSerde.
-
-
-
Constructor Detail
-
Serialized
protected Serialized(Serialized<K,V> serialized)
-
-
Method Detail
-
with
public static <K,V> Serialized<K,V> with(org.apache.kafka.common.serialization.Serde<K> keySerde, org.apache.kafka.common.serialization.Serde<V> valueSerde)
Construct aSerializedinstance with the provided key and valueSerdes. If theSerdeparams arenullthe default serdes defined in the configs will be used.- Type Parameters:
K- the key typeV- the value type- Parameters:
keySerde- keySerde that will be used to materialize a stream if not specified the default serdes defined in the configs will be usedvalueSerde- valueSerde that will be used to materialize a stream if not specified the default serdes defined in the configs will be used- Returns:
- a new instance of
Serializedconfigured with the provided serdes
-
withKeySerde
public Serialized<K,V> withKeySerde(org.apache.kafka.common.serialization.Serde<K> keySerde)
Construct aSerializedinstance with the provided keySerde. If theSerdeparams are null the default serdes defined in the configs will be used.- Parameters:
keySerde- keySerde that will be used to materialize a stream if not specified the default serdes defined in the configs will be used- Returns:
- a new instance of
Serializedconfigured with the provided key serde
-
withValueSerde
public Serialized<K,V> withValueSerde(org.apache.kafka.common.serialization.Serde<V> valueSerde)
Construct aSerializedinstance with the provided valueSerde. If theSerdeparams are null the default serdes defined in the configs will be used.- Parameters:
valueSerde- valueSerde that will be used to materialize a stream if not specified the default serdes defined in the configs will be used- Returns:
- a new instance of
Serializedconfigured with the provided key serde
-
-