CoderProviders (Google Cloud Dataflow SDK 1.9.1 API)

Google Cloud Dataflow SDK for Java, version 1.9.1

Class CoderProviders

  • public final class CoderProviders
    extends Object
    Static utility methods for working with CoderProviders.
    • Method Detail

      • fromStaticMethods

        public static <T> CoderProvider fromStaticMethods(Class<T> clazz)
        Creates a CoderProvider built from particular static methods of a class that implements Coder. The requirements for this method are precisely the requirements for a Coder class to be usable with DefaultCoder annotations.

        The class must have the following static method:

         public static Coder<T> of(TypeDescriptor<T> type)

      • firstOf

        public static CoderProvider firstOf(CoderProvider... coderProviders)
        Returns a CoderProvider that consults each of the provider coderProviders and returns the first Coder provided.

        Note that the order in which the providers are listed matters: While the set of types handled will be the union of those handled by all of the providers in the list, the actual Coder provided by the first successful provider may differ, and may have inferior properties. For example, not all Coders are deterministic, handle null values, or have comparable performance.