Package org.apache.beam.sdk.schemas
Class GetterBasedSchemaProvider
- java.lang.Object
-
- org.apache.beam.sdk.schemas.GetterBasedSchemaProvider
-
- All Implemented Interfaces:
java.io.Serializable
,SchemaProvider
- Direct Known Subclasses:
AutoValueSchema
,AvroRecordSchema
,JavaBeanSchema
,JavaFieldSchema
@Experimental(SCHEMAS) public abstract class GetterBasedSchemaProvider extends java.lang.Object implements SchemaProvider
ASchemaProvider
base class that vends schemas and rows based onFieldValueGetter
s.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GetterBasedSchemaProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object obj)
abstract java.util.List<FieldValueGetter>
fieldValueGetters(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return FieldValueGetters.abstract java.util.List<FieldValueTypeInformation>
fieldValueTypeInformations(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return a list of type-informations.<T> SerializableFunction<Row,T>
fromRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, returns a function that converts from aRow
object to that type.int
hashCode()
abstract SchemaUserTypeCreator
schemaTypeCreator(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return a constructor.<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.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.beam.sdk.schemas.SchemaProvider
schemaFor
-
-
-
-
Method Detail
-
fieldValueGetters
public abstract java.util.List<FieldValueGetter> fieldValueGetters(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return FieldValueGetters.
-
fieldValueTypeInformations
public abstract java.util.List<FieldValueTypeInformation> fieldValueTypeInformations(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return a list of type-informations.
-
schemaTypeCreator
public abstract SchemaUserTypeCreator schemaTypeCreator(java.lang.Class<?> targetClass, Schema schema)
Implementing class should override to return a constructor.
-
toRowFunction
public <T> SerializableFunction<T,Row> toRowFunction(TypeDescriptor<T> typeDescriptor)
Description copied from interface:SchemaProvider
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)
Description copied from interface:SchemaProvider
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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-