Class AvroTypeConverterWithStrictJavaTypeCheck<T>

java.lang.Object
tech.allegro.schema.json2avro.converter.types.AvroTypeConverterWithStrictJavaTypeCheck<T>
All Implemented Interfaces:
AvroTypeConverter
Direct Known Subclasses:
ArrayConverter, EnumConverter, MapConverter, PrimitiveConverter, RecordConverter

public abstract class AvroTypeConverterWithStrictJavaTypeCheck<T> extends Object implements AvroTypeConverter
  • Constructor Details

    • AvroTypeConverterWithStrictJavaTypeCheck

      protected AvroTypeConverterWithStrictJavaTypeCheck(Class<T> javaType)
  • Method Details

    • convert

      public Object convert(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, Object jsonValue, Deque<String> path, boolean silently)
      Description copied from interface: AvroTypeConverter
      convert the json jsonValue to the avro jsonValue
      Specified by:
      convert in interface AvroTypeConverter
      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
    • convertValue

      public abstract Object convertValue(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, T value, Deque<String> path, boolean silently)