Class CustomCoder<T>

java.lang.Object
org.apache.beam.sdk.coders.Coder<T>
org.apache.beam.sdk.coders.CustomCoder<T>
Type Parameters:
T - the type of values being encoded and decoded
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AmqpMessageCoder, ApproximateDistinct.HyperLogLogPlusCoder, AvroCoder, CoGbkResult.CoGbkResultCoder, CountingSource.CounterMarkCoder, DelegateCoder, FhirSearchParameterCoder, HealthcareIOErrorCoder, HL7v2MessageCoder, HL7v2ReadResponseCoder, IsmFormat.IsmRecordCoder, JAXBCoder, JsonArrayCoder, ProtoCoder, PubsubMessagePayloadOnlyCoder, PubsubMessageWithAttributesAndMessageIdAndOrderingKeyCoder, PubsubMessageWithAttributesAndMessageIdCoder, PubsubMessageWithAttributesCoder, PubsubMessageWithMessageIdCoder, PubsubMessageWithTopicCoder, PulsarMessageCoder, SchemaCoder, SequenceRangeAccumulator.SequenceRangeAccumulatorCoder, SerializableCoder, StringDelegateCoder, ThriftCoder, WritableCoder

public abstract class CustomCoder<T> extends Coder<T> implements Serializable
An abstract base class that implements all methods of Coder except Coder.encode(T, java.io.OutputStream) and Coder.decode(java.io.InputStream).
See Also:
  • Constructor Details

    • CustomCoder

      public CustomCoder()
  • Method Details

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

      Returns an empty list. A CustomCoder has no default argument coders.

      Specified by:
      getCoderArguments in class Coder<T>
    • 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 class Coder<T>
      Throws:
      Coder.NonDeterministicException - a CustomCoder is presumed nondeterministic.