Class DefaultSchema.DefaultSchemaProvider
- java.lang.Object
-
- org.apache.beam.sdk.schemas.annotations.DefaultSchema.DefaultSchemaProvider
-
- All Implemented Interfaces:
java.io.Serializable
,SchemaProvider
- Enclosing class:
- DefaultSchema
public static class DefaultSchema.DefaultSchemaProvider extends java.lang.Object implements SchemaProvider
SchemaProvider
for default schemas. Looks up the provider annotated for a type, and delegates to that provider.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemaProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> SerializableFunction<Row,T>
fromRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, returns a function that converts from aRow
object to that type.<T> Schema
schemaFor(TypeDescriptor<T> typeDescriptor)
Lookup a schema for the given type.<T> SerializableFunction<T,Row>
toRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, return a function that converts that type to aRow
object If no schema exists, returns null.
-
-
-
Method Detail
-
schemaFor
public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor)
Description copied from interface:SchemaProvider
Lookup a schema for the given type. If no schema exists, returns null.- Specified by:
schemaFor
in interfaceSchemaProvider
-
toRowFunction
public <T> SerializableFunction<T,Row> toRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, return a function that converts that type to aRow
object If no schema exists, returns null.- Specified by:
toRowFunction
in interfaceSchemaProvider
-
fromRowFunction
public <T> SerializableFunction<Row,T> fromRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, returns a function that converts from aRow
object to that type. If no schema exists, returns null.- Specified by:
fromRowFunction
in interfaceSchemaProvider
-
-