Class AtomicCoder<T>

Type Parameters:
T - the type of the values being transcoded
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AttributeValueCoder, BigDecimalCoder, BigEndianIntegerCoder, BigEndianLongCoder, BigEndianShortCoder, BigIntegerCoder, BigQueryInsertErrorCoder, BigQueryStorageApiInsertErrorCoder, BigtableWriteResultCoder, BitSetCoder, BooleanCoder, ByteArrayCoder, ByteCoder, ByteStringCoder, ByteStringCoder, DefaultFilenamePolicy.ParamsCoder, DoubleCoder, DurationCoder, ElasticsearchIO.DocumentCoder, EncodedBoundedWindow.Coder, FloatCoder, InstantCoder, IsmFormat.FooterCoder, IsmFormat.IsmShardCoder, IsmFormat.KeyPrefixCoder, MetadataCoder, MetadataCoderV2, OffsetByteRangeCoder, OffsetRange.Coder, PaneInfo.PaneInfoCoder, RandomAccessData.RandomAccessDataCoder, ResourceIdCoder, RowMutation.RowMutationCoder, SplunkEventCoder, StringUtf8Coder, SubscriptionPartitionCoder, TableDestinationCoder, TableDestinationCoderV2, TableDestinationCoderV3, TableRowJsonCoder, TextualIntegerCoder, UuidCoder, VarIntCoder, VoidCoder

public abstract class AtomicCoder<T> extends StructuredCoder<T>
A Coder that has no component Coders or other configuration.

Unless the behavior is overridden, atomic coders are presumed to be deterministic.

All atomic coders of the same class are considered to be equal to each other. As a result, an AtomicCoder should have no associated configuration (instance variables, etc).

See Also:
  • Constructor Details

    • AtomicCoder

      public AtomicCoder()
  • Method Details

    • 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.
      .

      Unless overridden, does not throw. An AtomicCoder is presumed to be deterministic

      Specified by:
      verifyDeterministic in class Coder<T>
      Throws:
      Coder.NonDeterministicException - if overridden to indicate that this subclass of AtomicCoder is not deterministic
    • getCoderArguments

      public List<? extends Coder<?>> getCoderArguments()
      If this is a Coder for a parameterized type, returns the list of Coders being used for each of the parameters in the same order they appear within the parameterized type's type signature. If this cannot be done, or this Coder does not encode/decode a parameterized type, returns the empty list..
      Specified by:
      getCoderArguments in class Coder<T>
      Returns:
      the empty list
    • getComponents

      public final List<? extends Coder<?>> getComponents()
      Returns the list of Coders that are components of this Coder.

      The default components will be equal to the value returned by Coder.getCoderArguments()..

      Overrides:
      getComponents in class StructuredCoder<T>
      Returns:
      the empty List.
    • equals

      public final boolean equals(@Nullable Object other)
      .
      Overrides:
      equals in class StructuredCoder<T>
      Returns:
      true if the other object has the same class as this AtomicCoder.
    • hashCode

      public final int hashCode()
      .
      Overrides:
      hashCode in class StructuredCoder<T>
      Returns:
      the hashCode() of the Class of this AtomicCoder.