Package org.apache.kafka.streams.kstream
Interface KeyValueMapper<K,V,VR>
-
- Type Parameters:
K- key typeV- value typeVR- mapped value type
public interface KeyValueMapper<K,V,VR>TheKeyValueMapperinterface for mapping akey-value pairto a new value of arbitrary type. For example, it can be used to- map from an input
KeyValuepair to an outputKeyValuepair with different key and/or value type (for this case output typeVR ==KeyValue<NewKeyType,NewValueType>) - map from an input record to a new key (with arbitrary key type as specified by
VR)
apply(Object, Object)is invoked individually for each record of a stream (cf.Transformerfor stateful record transformation).KeyValueMapperis a generalization ofValueMapper.- See Also:
ValueMapper,Transformer,KStream.map(KeyValueMapper),KStream.flatMap(KeyValueMapper),KStream.selectKey(KeyValueMapper),KStream.groupBy(KeyValueMapper),KStream.groupBy(KeyValueMapper, Grouped),KTable.groupBy(KeyValueMapper),KTable.groupBy(KeyValueMapper, Grouped),KTable.toStream(KeyValueMapper)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VRapply(K key, V value)Map a record with the given key and value to a new value.
-