Interface AvroTypeConverter

All Known Implementing Classes:
AbstractDateTimeConverter, AbstractIntDateTimeConverter, AbstractLongDateTimeConverter, ArrayConverter, AvroTypeConverterWithStrictJavaTypeCheck, BytesDecimalConverter, EnumConverter, IntDateConverter, IntTimeMillisConverter, LongTimeMicrosConverter, LongTimestampMicrosConverter, LongTimestampMillisConverter, MapConverter, NullConverter, PrimitiveConverter, RecordConverter, UnionConverter

public interface AvroTypeConverter
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canManage(org.apache.avro.Schema schema, Deque<String> path)
    used to know if this class can convert the json value to the avro value
    convert(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, Object jsonValue, Deque<String> path, boolean silently)
    convert the json jsonValue to the avro jsonValue
    static boolean
    isLogicalType(org.apache.avro.Schema schema, String logicalType)
     
  • Method Details

    • convert

      Object convert(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, Object jsonValue, Deque<String> path, boolean silently)
      convert the json jsonValue to the avro jsonValue
      Parameters:
      field - the field to convert
      schema - the schema of the field
      jsonValue - the json jsonValue
      path - the path of the field
      silently - should be false to throw an error in case of incompatible java type for the avro type
      Returns:
      the converted jsonValue or an Incompatible instance if silently is true and value is incompatible
    • canManage

      boolean canManage(org.apache.avro.Schema schema, Deque<String> path)
      used to know if this class can convert the json value to the avro value
      Parameters:
      schema - the avro schema in which to convert the json
      path - the path of the current field. Can be used to define a specific converter for a path
      Returns:
      true if this class should be used to convert the value
    • isLogicalType

      static boolean isLogicalType(org.apache.avro.Schema schema, String logicalType)