Class StaticSchemaInference


  • @Experimental(SCHEMAS)
    public class StaticSchemaInference
    extends java.lang.Object
    A set of utilities for inferring a Beam Schema from static Java types.
    • Constructor Detail

      • StaticSchemaInference

        public StaticSchemaInference()
    • Method Detail

      • schemaFromClass

        public static Schema schemaFromClass​(java.lang.Class<?> clazz,
                                             FieldValueTypeSupplier fieldValueTypeSupplier)
        Infer a schema from a Java class.

        Takes in a function to extract a list of field types from a class. Different callers may have different strategies for extracting this list: e.g. introspecting public member variables, public getter methods, or special annotations on the class.