SetCoder (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

Class SetCoder<T>

    • Constructor Detail

      • SetCoder

        protected SetCoder(Coder<T> elemCoder)
    • Method Detail

      • of

        public static <T> SetCoder<T> of(Coder<T> elementCoder)
        Produces a SetCoder with the given elementCoder.
      • of

        public static SetCoder<?> of(List<Object> components)
        Dynamically typed constructor for JSON deserialization.
      • 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<Set<T>>
        verifyDeterministic in class IterableLikeCoder<T,Set<T>>
        NonDeterministicException - always. Sets are not ordered, but they are encoded in the order of an arbitrary iteration.
        Coder.NonDeterministicException - if this coder is not deterministic.
      • getInstanceComponents

        public static <T> List<Object> getInstanceComponents(Set<T> exampleValue)
        Returns the first element in this set if it is non-empty, otherwise returns null.