Class Windowed<K>

java.lang.Object
org.apache.kafka.streams.kstream.Windowed<K>
Type Parameters:
K - type of the key

public class Windowed<K>
extends Object
The result key type of a windowed stream aggregation.

If a KStream gets grouped and aggregated using a window-aggregation the resulting KTable is a so-called "windowed KTable" with a combined key type that encodes the corresponding aggregation window and the original record key. Thus, a windowed KTable has type <Windowed<K>,V>.

See Also:
KGroupedStream.windowedBy(Windows), KGroupedStream.windowedBy(SessionWindows)
  • Constructor Details

    • Windowed

      public Windowed​(K key, Window window)
  • Method Details

    • key

      public K key()
      Return the key of the window.
      Returns:
      the key of the window
    • window

      public Window window()
      Return the window containing the values associated with this key.
      Returns:
      the window containing the values
    • 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