接口 SchemaDefinitionBuilder<T>

    • 方法详细资料

      • withAlwaysAllowNull

        SchemaDefinitionBuilder<T> withAlwaysAllowNull​(boolean alwaysAllowNull)
        Set schema whether always allow null or not.
        参数:
        alwaysAllowNull - definition null or not
        返回:
        schema definition builder
      • withJSR310ConversionEnabled

        SchemaDefinitionBuilder<T> withJSR310ConversionEnabled​(boolean jsr310ConversionEnabled)
        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

        参数:
        jsr310ConversionEnabled - use JRS310 conversion or not, default is false for keep forwarding compatibility
        返回:
        schema definition builder
      • withProperties

        SchemaDefinitionBuilder<T> withProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
        Set schema info properties.
        参数:
        properties - schema info properties
        返回:
        schema definition builder
      • addProperty

        SchemaDefinitionBuilder<T> addProperty​(java.lang.String key,
                                               java.lang.String value)
        Set schema info properties.
        参数:
        key - property key
        value - property value
        返回:
        schema definition builder
      • withPojo

        SchemaDefinitionBuilder<T> withPojo​(java.lang.Class pojo)
        Set schema of pojo definition.
        参数:
        pojo - pojo schema definition
        返回:
        schema definition builder
      • withClassLoader

        SchemaDefinitionBuilder<T> withClassLoader​(java.lang.ClassLoader classLoader)
        Set schema of pojo classLoader.
        参数:
        classLoader - pojo classLoader
        返回:
        schema definition builder
      • withJsonDef

        SchemaDefinitionBuilder<T> withJsonDef​(java.lang.String jsonDefinition)
        Set schema of json definition.
        参数:
        jsonDefinition - json schema definition
        返回:
        schema definition builder
      • withSupportSchemaVersioning

        SchemaDefinitionBuilder<T> withSupportSchemaVersioning​(boolean supportSchemaVersioning)
        Set schema whether decode by schema version.
        参数:
        supportSchemaVersioning - decode by version
        返回:
        schema definition builder
      • withSchemaReader

        SchemaDefinitionBuilder<T> withSchemaReader​(SchemaReader<T> reader)
        Set schema reader for deserialization of object data.
        参数:
        reader - reader for object data
        返回:
        schema definition builder
      • withSchemaWriter

        SchemaDefinitionBuilder<T> withSchemaWriter​(SchemaWriter<T> writer)
        Set schema writer for serialization of objects.
        参数:
        writer - writer for objects
        返回:
        schema definition builder
      • build

        SchemaDefinition<T> build()
        Build the schema definition.
        返回:
        the schema definition.