com.google.cloud.dataflow.sdk.runners

## Class DirectPipelineRunner.ValueWithMetadata<V>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner.ValueWithMetadata<V>

Enclosing class:
  DirectPipelineRunner

    public static class DirectPipelineRunner.ValueWithMetadata<V>
    extends Object

An immutable (value, timestamp) pair, along with other metadata necessary for the implementation of `DirectPipelineRunner`.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Object` `getKey()` Returns the key associated with this element.
`Instant` `getTimestamp()` Returns the timestamp associated with this element.
`V` `getValue()` Returns the value associated with this element.
`com.google.cloud.dataflow.sdk.util.WindowedValue<V>` `getWindowedValue()` Returns the `WindowedValue` associated with this element.
`Collection<? extends BoundedWindow>` `getWindows()` Returns the collection of windows this element has been placed into.
`static <V> DirectPipelineRunner.ValueWithMetadata<V>` `of(com.google.cloud.dataflow.sdk.util.WindowedValue<V> windowedValue)` Returns a new `ValueWithMetadata` with the `WindowedValue`.
`DirectPipelineRunner.ValueWithMetadata<V>` `withKey(Object key)` Returns a new `ValueWithMetadata` with the implicit key associated with this value set.
`<T> DirectPipelineRunner.ValueWithMetadata<T>` `withValue(T value)` Returns a new `ValueWithMetadata` that is a copy of this one, but with a different value.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### of

    public static <V> DirectPipelineRunner.ValueWithMetadata<V> of(com.google.cloud.dataflow.sdk.util.WindowedValue<V> windowedValue)

Returns a new `ValueWithMetadata` with the `WindowedValue`. Key is null.

#### withKey

    public DirectPipelineRunner.ValueWithMetadata<V> withKey(Object key)

Returns a new `ValueWithMetadata` with the implicit key associated with this value set. The key is the last key grouped by in the chain of productions that produced this element. These keys are used internally by `DirectPipelineRunner` for keeping persisted state separate across keys.

#### withValue

    public <T> DirectPipelineRunner.ValueWithMetadata<T> withValue(T value)

Returns a new `ValueWithMetadata` that is a copy of this one, but with a different value.

#### getWindowedValue

    public com.google.cloud.dataflow.sdk.util.WindowedValue<V> getWindowedValue()

Returns the `WindowedValue` associated with this element.

#### getValue

    public V getValue()

Returns the value associated with this element.

See Also:
  `withValue(T)`

#### getTimestamp

    public Instant getTimestamp()

Returns the timestamp associated with this element.

#### getWindows

    public Collection<? extends BoundedWindow> getWindows()

Returns the collection of windows this element has been placed into. May be null if the `PCollection` this element is in has not yet been windowed.

See Also:
  `getWindows()`

#### getKey

    public Object getKey()

Returns the key associated with this element. May be null if the `PCollection` this element is in is not keyed.

See Also:
  `withKey(java.lang.Object)`