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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanused to know if this class can convert the json value to the avro valueconvert(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 jsonValuestatic booleanisLogicalType(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 convertschema- the schema of the fieldjsonValue- the json jsonValuepath- the path of the fieldsilently- 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
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 jsonpath- 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
-