com.hazelcast.jet.datamodel

## Class TimestampedItem<T>

- java.lang.Object
- - com.hazelcast.jet.datamodel.TimestampedItem<T>

- Type Parameters:
    `T` - type of the item
  All Implemented Interfaces:
    Serializable

      public final class TimestampedItem<T>
      extends Object
      implements Serializable

  Represents a data item with the event timestamp added to it. Used in the Pipeline API as the default data type to emit from global windowed aggregation stages (those that aggregate all the data in a window, without grouping).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimestampedItem(long timestamp, T item)` Constructs a timestamped item with the supplied field values.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `static <V> TimestampedItem<V>` | `fromWindowResult(long winStart, long winEnd, V value)` This method matches the shape of the functional interface `WindowResultFunction`.
    `int` | `hashCode()`
    `T` | `item()` Returns the item.
    `long` | `timestamp()` Returns the timestamp associated with the item.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### TimestampedItem

          public TimestampedItem(long timestamp,
                                 @Nonnull
                                 T item)

      Constructs a timestamped item with the supplied field values.

  - ### Method Detail

    - #### timestamp

          public long timestamp()

      Returns the timestamp associated with the item.

    - #### item

          public T item()

      Returns the item.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### fromWindowResult

          public static <V> TimestampedItem<V> fromWindowResult(long winStart,
                                                                long winEnd,
                                                                @Nonnull
                                                                V value)

      This method matches the shape of the functional interface `WindowResultFunction`.

      Constructs a `TimestampedItem` using the window end time as the timestamp.

Copyright © 2018. All rights reserved.