com.hazelcast.jet.datamodel

## Class KeyedWindowResult<K,R>

- java.lang.Object
- - com.hazelcast.jet.datamodel.WindowResult<R>
  - - com.hazelcast.jet.datamodel.KeyedWindowResult<K,R>

- Type Parameters:
    `K` - type of the grouping key
    `R` - type of the aggregated result
  All Implemented Interfaces:
    Map.Entry<K,R>

      public final class KeyedWindowResult<K,R>
      extends WindowResult<R>
      implements Map.Entry<K,R>

  Holds the result of a group-and-aggregate operation performed over a time window.
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeyedWindowResult(long start, long end, K key, R result)` Constructs a keyed window result that is not early.
    `KeyedWindowResult(long start, long end, K key, R result, boolean isEarly)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `K` | `getKey()` Alias for `key`, implements `Map.Entry`.
    `R` | `getValue()` Alias for `WindowResult.result()`, implements `Map.Entry`.
    `int` | `hashCode()`
    `K` | `key()` Returns the grouping key.
    `R` | `setValue(R value)` Implements `Map.Entry`, throws `UnsupportedOperationException`.
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.jet.datamodel.WindowResult

      `end, isEarly, result, start`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map.Entry

      `comparingByKey, comparingByKey, comparingByValue, comparingByValue`

- - ### Constructor Detail

    - #### KeyedWindowResult

          public KeyedWindowResult(long start,
                                   long end,
                                   @Nonnull
                                   K key,
                                   @Nonnull
                                   R result,
                                   boolean isEarly)

      Parameters:
        `start` - start time of the window
        `end` - end time of the window
        `key` - grouping key
        `result` - result of aggregation
        `isEarly` - whether this is an early result, to be followed by the final one

    - #### KeyedWindowResult

          public KeyedWindowResult(long start,
                                   long end,
                                   @Nonnull
                                   K key,
                                   @Nonnull
                                   R result)

      Constructs a keyed window result that is not early.
      Parameters:
        `start` - start time of the window
        `end` - end time of the window
        `key` - grouping key
        `result` - result of aggregation

  - ### Method Detail

    - #### key

          @Nonnull
          public K key()

      Returns the grouping key.

    - #### getKey

          public K getKey()

      Alias for `key`, implements `Map.Entry`.
      Specified by:
        `getKey` in interface `Map.Entry<K,R>`

    - #### getValue

          public R getValue()

      Alias for `WindowResult.result()`, implements `Map.Entry`.
      Specified by:
        `getValue` in interface `Map.Entry<K,R>`

    - #### setValue

          public R setValue(R value)

      Implements `Map.Entry`, throws `UnsupportedOperationException`.
      Specified by:
        `setValue` in interface `Map.Entry<K,R>`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in interface `Map.Entry<K,R>`
      Overrides:
        `equals` in class `WindowResult<R>`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Map.Entry<K,R>`
      Overrides:
        `hashCode` in class `WindowResult<R>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `WindowResult<R>`

Copyright © 2020. All rights reserved.