com.google.cloud.dataflow.sdk.values

## Class TypedPValue<T>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.values.POutputValueBase
  - - com.google.cloud.dataflow.sdk.values.PValueBase
    - - com.google.cloud.dataflow.sdk.values.TypedPValue<T>

Type Parameters:
  `T` - the type of the values stored in this `TypedPValue`

All Implemented Interfaces:
  PInput, POutput, PValue

Direct Known Subclasses:
  PCollection

    public abstract class TypedPValue<T>
    extends PValueBase
    implements PValue

A `TypedPValue<T>` is the abstract base class of things that store some number of values of type `T`.

Because we know the type `T`, this is the layer of the inheritance hierarchy where we store a coder for objects of type `T`.

### Constructor Summary

Constructors
`protected` `TypedPValue(Pipeline p)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `finishSpecifying()` After building, finalizes this `PValue` to make it ready for running.
`Coder<T>` `getCoder()` Returns the `Coder` used by this `TypedPValue` to encode and decode the values stored in it.
`TypeDescriptor<T>` `getTypeDescriptor()` Returns a `TypeDescriptor<T>` with some reflective information about `T`, if possible.
`TypedPValue<T>` `setCoder(Coder<T> coder)` Sets the `Coder` used by this `TypedPValue` to encode and decode the values stored in it.
`TypedPValue<T>` `setTypeDescriptorInternal(TypeDescriptor<T> typeDescriptor)` Sets the `TypeDescriptor<T>` associated with this class.

### Methods inherited from class com.google.cloud.dataflow.sdk.values.PValueBase

`expand, getKindString, getName, isFinishedSpecifyingInternal, recordAsOutput, recordAsOutput, setName, toString`

### Methods inherited from class com.google.cloud.dataflow.sdk.values.POutputValueBase

`finishSpecifyingOutput, getPipeline, getProducingTransformInternal`

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

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

### Methods inherited from interface com.google.cloud.dataflow.sdk.values.PValue

`getName, getProducingTransformInternal`

### Methods inherited from interface com.google.cloud.dataflow.sdk.values.POutput

`expand, finishSpecifyingOutput, getPipeline, recordAsOutput`

### Methods inherited from interface com.google.cloud.dataflow.sdk.values.PInput

`expand, getPipeline`

### Constructor Detail

#### TypedPValue

    protected TypedPValue(Pipeline p)

### Method Detail

#### getCoder

    public Coder<T> getCoder()

Returns the `Coder` used by this `TypedPValue` to encode and decode the values stored in it.

Throws:
  `IllegalStateException` - if the `Coder` hasn't been set, and couldn't be inferred.

#### setCoder

    public TypedPValue<T> setCoder(Coder<T> coder)

Sets the `Coder` used by this `TypedPValue` to encode and decode the values stored in it. Returns `this`.

Throws:
  `IllegalStateException` - if this `TypedPValue` has already been finalized and is no longer settable, e.g., by having `apply()` called on it

#### finishSpecifying

    public void finishSpecifying()

After building, finalizes this `PValue` to make it ready for running. Automatically invoked whenever the `PValue` is "used" (e.g., when apply() is called on it) and when the Pipeline is run (useful if this is a `PValue` with no consumers).

Specified by:
  `finishSpecifying` in interface `PInput`
Overrides:
  `finishSpecifying` in class `PValueBase`

#### getTypeDescriptor

    public TypeDescriptor<T> getTypeDescriptor()

Returns a `TypeDescriptor<T>` with some reflective information about `T`, if possible. May return `null` if no information is available. Subclasses may override this to enable better `Coder` inference.

#### setTypeDescriptorInternal

    public TypedPValue<T> setTypeDescriptorInternal(TypeDescriptor<T> typeDescriptor)

Sets the `TypeDescriptor<T>` associated with this class. Better reflective type information will lead to better `Coder` inference.