com.google.cloud.dataflow.sdk.transforms

## Class DoFn.ProcessContext

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.DoFn.Context
  - - com.google.cloud.dataflow.sdk.transforms.DoFn.ProcessContext

Enclosing class:
  DoFn<InputT,OutputT>

    public abstract class DoFn.ProcessContext
    extends DoFn.Context

Information accessible when running `DoFn.processElement(com.google.cloud.dataflow.sdk.transforms.DoFn<InputT, OutputT>.ProcessContext)`.

### Constructor Summary

Constructors
Constructor and Description
`ProcessContext()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract InputT` `element()` Returns the input element to be processed.
`abstract PaneInfo` `pane()` Returns information about the pane within this window into which the input element has been assigned.
`abstract <T> T` `sideInput(PCollectionView<T> view)` Returns the value of the side input for the window corresponding to the window of the main input element.
`abstract Instant` `timestamp()` Returns the timestamp of the input element.
`abstract BoundedWindow` `window()` Returns the window into which the input element has been assigned.
`abstract com.google.cloud.dataflow.sdk.util.WindowingInternals<InputT,OutputT>` `windowingInternals()` Returns the process context to use for implementing windowing.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.DoFn.Context

`createAggregatorInternal, getPipelineOptions, output, outputWithTimestamp, setupDelegateAggregators, sideOutput, sideOutputWithTimestamp`

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

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

### Constructor Detail

#### ProcessContext

    public ProcessContext()

### Method Detail

#### element

    public abstract InputT element()

Returns the input element to be processed.

The element should be considered immutable. The Dataflow runtime will not mutate the element, so it is safe to cache, etc. The element should not be mutated by any of the `DoFn` methods, because it may be cached elsewhere, retained by the Dataflow runtime, or used in other unspecified ways.

#### sideInput

    public abstract <T> T sideInput(PCollectionView<T> view)

Returns the value of the side input for the window corresponding to the window of the main input element.

See `WindowFn.getSideInputWindow(com.google.cloud.dataflow.sdk.transforms.windowing.BoundedWindow)` for how this corresponding window is determined.

Throws:
  `IllegalArgumentException` - if this is not a side input
See Also:
  `ParDo.withSideInputs(com.google.cloud.dataflow.sdk.values.PCollectionView<?>...)`

#### timestamp

    public abstract Instant timestamp()

Returns the timestamp of the input element.

See `Window` for more information.

#### window

    public abstract BoundedWindow window()

Returns the window into which the input element has been assigned.

See `Window` for more information.

Throws:
  `UnsupportedOperationException` - if this `DoFn` does not implement `DoFn.RequiresWindowAccess`.

#### pane

    public abstract PaneInfo pane()

Returns information about the pane within this window into which the input element has been assigned.

Generally all data is in a single, uninteresting pane unless custom triggering and/or late data has been explicitly requested. See `Window` for more information.

#### windowingInternals

    @Experimental
    public abstract com.google.cloud.dataflow.sdk.util.WindowingInternals<InputT,OutputT> windowingInternals()

Returns the process context to use for implementing windowing.