com.google.cloud.dataflow.sdk.coders

## Class TableRowJsonCoder

- java.lang.Object
- - com.google.cloud.dataflow.sdk.coders.StandardCoder<T>
  - - com.google.cloud.dataflow.sdk.coders.DeterministicStandardCoder<T>
    - - com.google.cloud.dataflow.sdk.coders.AtomicCoder<TableRow>
      - - com.google.cloud.dataflow.sdk.coders.TableRowJsonCoder

All Implemented Interfaces:
  Coder<TableRow>, Serializable

    public class TableRowJsonCoder
    extends AtomicCoder<TableRow>

A `Coder` that encodes BigQuery `TableRow` objects in their native JSON format.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.google.cloud.dataflow.sdk.coders.Coder

`Coder.Context, Coder.NonDeterministicException`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`TableRow` `decode(InputStream inStream, Coder.Context context)` Decodes a value of type `T` from the given input stream in the given context.
`void` `encode(TableRow value, OutputStream outStream, Coder.Context context)` Encodes the given value of type `T` onto the given output stream in the given context.
`protected long` `getEncodedElementByteSize(TableRow value, Coder.Context context)` Returns the size in bytes of the encoded value using this coder.
`static TableRowJsonCoder` `of()`
`void` `verifyDeterministic()` Throw `Coder.NonDeterministicException` if the coding is not deterministic.

### Methods inherited from class com.google.cloud.dataflow.sdk.coders.AtomicCoder

`getCoderArguments, getInstanceComponents`

### Methods inherited from class com.google.cloud.dataflow.sdk.coders.StandardCoder

`asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministic`

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

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

### Method Detail

#### of

    public static TableRowJsonCoder of()

#### encode

    public void encode(TableRow value,
                       OutputStream outStream,
                       Coder.Context context)
                throws IOException

Description copied from interface: `Coder`
Encodes the given value of type `T` onto the given output stream in the given context.

Throws:
  `IOException` - if writing to the `OutputStream` fails for some reason
  `CoderException` - if the value could not be encoded for some reason

#### decode

    public TableRow decode(InputStream inStream,
                           Coder.Context context)
                    throws IOException

Description copied from interface: `Coder`
Decodes a value of type `T` from the given input stream in the given context. Returns the decoded value.

Throws:
  `IOException` - if reading from the `InputStream` fails for some reason
  `CoderException` - if the value could not be decoded for some reason

#### getEncodedElementByteSize

    protected long getEncodedElementByteSize(TableRow value,
                                             Coder.Context context)
                                      throws Exception

Description copied from class: `StandardCoder`
Returns the size in bytes of the encoded value using this coder.

Overrides:
  `getEncodedElementByteSize` in class `StandardCoder<TableRow>`
Throws:
  `Exception`

#### verifyDeterministic

    public void verifyDeterministic()
                             throws Coder.NonDeterministicException

Throw `Coder.NonDeterministicException` if the coding is not deterministic.

In order for a `Coder` to be considered deterministic, the following must be true:

- two values that compare as equal (via `Object.equals()` or `Comparable.compareTo()`, if supported) have the same encoding.
- the `Coder` always produces a canonical encoding, which is the same for an instance of an object even if produced on different computers at different times.

Specified by:
  `verifyDeterministic` in interface `Coder<TableRow>`
Overrides:
  `verifyDeterministic` in class `DeterministicStandardCoder<TableRow>`
Throws:
  `NonDeterministicException` - always. A `TableRow` can hold arbitrary `Object` instances, which makes the encoding non-deterministic.
  `Coder.NonDeterministicException` - if this coder is not deterministic.