Interface SchemaDefinitionBuilder<T>
Builder to build schema definition
SchemaDefinition
.-
Method Summary
Modifier and TypeMethodDescriptionaddProperty
(String key, String value) Set schema info properties.build()
Build the schema definition.withAlwaysAllowNull
(boolean alwaysAllowNull) Set schema whether always allow null or not.withClassLoader
(ClassLoader classLoader) Set schema of pojo classLoader.withJsonDef
(String jsonDefinition) Set schema of json definition.withJSR310ConversionEnabled
(boolean jsr310ConversionEnabled) Set schema use JRS310 conversion or not.Set schema of pojo definition.withProperties
(Map<String, String> properties) Set schema info properties.withSchemaReader
(SchemaReader<T> reader) Set schema reader for deserialization of object data.withSchemaWriter
(SchemaWriter<T> writer) Set schema writer for serialization of objects.withSupportSchemaVersioning
(boolean supportSchemaVersioning) Set schema whether decode by schema version.
-
Method Details
-
withAlwaysAllowNull
Set schema whether always allow null or not.- Parameters:
alwaysAllowNull
- definition null or not- Returns:
- schema definition builder
-
withJSR310ConversionEnabled
Set schema use JRS310 conversion or not.Before Avro 1.9 the Joda time library was used for handling the logical date(time) values. But since the introduction of Java8 the Java Specification Request (JSR) 310 has been included, which greatly improves the handling of date and time natively. To keep forwarding compatibility, default is use Joda time conversion.
JSR310 conversion is recommended here. Joda time conversion is has been marked deprecated. In future versions, joda time conversion may be removed
- Parameters:
jsr310ConversionEnabled
- use JRS310 conversion or not, default is false for keep forwarding compatibility- Returns:
- schema definition builder
-
withProperties
Set schema info properties.- Parameters:
properties
- schema info properties- Returns:
- schema definition builder
-
addProperty
Set schema info properties.- Parameters:
key
- property keyvalue
- property value- Returns:
- schema definition builder
-
withPojo
Set schema of pojo definition.- Parameters:
pojo
- pojo schema definition- Returns:
- schema definition builder
-
withClassLoader
Set schema of pojo classLoader.- Parameters:
classLoader
- pojo classLoader- Returns:
- schema definition builder
-
withJsonDef
Set schema of json definition.- Parameters:
jsonDefinition
- json schema definition- Returns:
- schema definition builder
-
withSupportSchemaVersioning
Set schema whether decode by schema version.- Parameters:
supportSchemaVersioning
- decode by version- Returns:
- schema definition builder
-
withSchemaReader
Set schema reader for deserialization of object data.- Parameters:
reader
- reader for object data- Returns:
- schema definition builder
-
withSchemaWriter
Set schema writer for serialization of objects.- Parameters:
writer
- writer for objects- Returns:
- schema definition builder
-
build
SchemaDefinition<T> build()Build the schema definition.- Returns:
- the schema definition.
-