Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.coders
Class CoderProviders
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.CoderProviders
-
public final class CoderProviders extends Object
Static utility methods for working withCoderProviders
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static CoderProvider
firstOf(CoderProvider... coderProviders)
Returns aCoderProvider
that consults each of the providercoderProviders
and returns the firstCoder
provided.static <T> CoderProvider
fromStaticMethods(Class<T> clazz)
Creates aCoderProvider
built from particular static methods of a class that implementsCoder
.
-
-
-
Method Detail
-
fromStaticMethods
public static <T> CoderProvider fromStaticMethods(Class<T> clazz)
Creates aCoderProvider
built from particular static methods of a class that implementsCoder
. The requirements for this method are precisely the requirements for aCoder
class to be usable withDefaultCoder
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 aCoderProvider
that consults each of the providercoderProviders
and returns the firstCoder
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 allCoders
are deterministic, handlenull
values, or have comparable performance.
-
-