Package org.apache.kafka.streams.kstream
Class Produced<K,V> 
java.lang.Object
org.apache.kafka.streams.kstream.Produced<K,V> 
- Type Parameters:
- K- key type
- V- value type
This class is used to provide the optional parameters when producing to new topics
 using 
KStream.to(String, Produced).- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected StreamPartitioner<? super K,? super V> protected String
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <K,V> Produced<K, V> Create an instance ofProducedwith provided processor name.booleaninthashCode()static <K,V> Produced<K, V> Create a Produced instance with provided keySerde.static <K,V> Produced<K, V> streamPartitioner(StreamPartitioner<? super K, ? super V> partitioner) Create a Produced instance with provided partitioner.static <K,V> Produced<K, V> valueSerde(Serde<V> valueSerde) Create a Produced instance with provided valueSerde.static <K,V> Produced<K, V> Create a Produced instance with provided keySerde and valueSerde.static <K,V> Produced<K, V> with(Serde<K> keySerde, Serde<V> valueSerde, StreamPartitioner<? super K, ? super V> partitioner) Create a Produced instance with provided keySerde, valueSerde, and partitioner.withKeySerde(Serde<K> keySerde) Produce records using the provided keySerde.withStreamPartitioner(StreamPartitioner<? super K, ? super V> partitioner) Produce records using the provided partitioner.withValueSerde(Serde<V> valueSerde) Produce records using the provided valueSerde.
- 
Field Details- 
keySerde
- 
valueSerde
- 
partitioner
- 
processorName
 
- 
- 
Constructor Details- 
Produced
 
- 
- 
Method Details- 
withCreate a Produced instance with provided keySerde and valueSerde.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- keySerde- Serde to use for serializing the key
- valueSerde- Serde to use for serializing the value
- Returns:
- A new Producedinstance configured with keySerde and valueSerde
- See Also:
 
- 
withpublic static <K,V> Produced<K,V> with(Serde<K> keySerde, Serde<V> valueSerde, StreamPartitioner<? super K, ? super V> partitioner) Create a Produced instance with provided keySerde, valueSerde, and partitioner.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- keySerde- Serde to use for serializing the key
- valueSerde- Serde to use for serializing the value
- partitioner- the function used to determine how records are distributed among partitions of the topic, if not specified and- keySerdeprovides a- WindowedSerializerfor the key- WindowedStreamPartitionerwill be used—otherwise- DefaultPartitionerwill be used
- Returns:
- A new Producedinstance configured with keySerde, valueSerde, and partitioner
- See Also:
 
- 
asCreate an instance ofProducedwith provided processor name.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- processorName- the processor name to be used. If- nulla default processor name will be generated
- Returns:
- a new instance of Produced
 
- 
keySerdeCreate a Produced instance with provided keySerde.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- keySerde- Serde to use for serializing the key
- Returns:
- A new Producedinstance configured with keySerde
- See Also:
 
- 
valueSerdeCreate a Produced instance with provided valueSerde.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- valueSerde- Serde to use for serializing the key
- Returns:
- A new Producedinstance configured with valueSerde
- See Also:
 
- 
streamPartitionerpublic static <K,V> Produced<K,V> streamPartitioner(StreamPartitioner<? super K, ? super V> partitioner) Create a Produced instance with provided partitioner.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- partitioner- the function used to determine how records are distributed among partitions of the topic, if not specified and the key serde provides a- WindowedSerializerfor the key- WindowedStreamPartitionerwill be used—otherwise- DefaultPartitionerwill be used
- Returns:
- A new Producedinstance configured with partitioner
- See Also:
 
- 
withStreamPartitionerProduce records using the provided partitioner.- Parameters:
- partitioner- the function used to determine how records are distributed among partitions of the topic, if not specified and the key serde provides a- WindowedSerializerfor the key- WindowedStreamPartitionerwill be used—otherwise- DefaultPartitionerwil be used
- Returns:
- this
 
- 
withValueSerdeProduce records using the provided valueSerde.- Parameters:
- valueSerde- Serde to use for serializing the value
- Returns:
- this
 
- 
withKeySerdeProduce records using the provided keySerde.- Parameters:
- keySerde- Serde to use for serializing the key
- Returns:
- this
 
- 
equals
- 
hashCodepublic int hashCode()
- 
withName
 
-