Class KeyValue<K,V>

java.lang.Object
org.apache.kafka.streams.KeyValue<K,V>
Type Parameters:
K - Key type
V - Value type

public class KeyValue<K,V> extends Object
A key-value pair defined for a single Kafka Streams record. If the record comes directly from a Kafka topic then its key/value are defined as the message key/value.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final K
    The key of the key-value pair.
    final V
    The value of the key-value pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyValue(K key, V value)
    Create a new key-value pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    static <K, V> KeyValue<K,V>
    pair(K key, V value)
    Create a new key-value pair.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      public final K key
      The key of the key-value pair.
    • value

      public final V value
      The value of the key-value pair.
  • Constructor Details

    • KeyValue

      public KeyValue(K key, V value)
      Create a new key-value pair.
      Parameters:
      key - the key
      value - the value
  • Method Details

    • pair

      public static <K, V> KeyValue<K,V> pair(K key, V value)
      Create a new key-value pair.
      Type Parameters:
      K - the type of the key
      V - the type of the value
      Parameters:
      key - the key
      value - the value
      Returns:
      a new key-value pair
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object