Class PrimitiveConverter<T>

java.lang.Object
tech.allegro.schema.json2avro.converter.types.AvroTypeConverterWithStrictJavaTypeCheck<T>
tech.allegro.schema.json2avro.converter.types.PrimitiveConverter<T>
All Implemented Interfaces:
AvroTypeConverter

public class PrimitiveConverter<T> extends AvroTypeConverterWithStrictJavaTypeCheck<T>
  • Field Details

  • Constructor Details

    • PrimitiveConverter

      protected PrimitiveConverter(org.apache.avro.Schema.Type avroType, Class<T> javaType, Function<T,Object> mapper)
  • Method Details

    • convertValue

      public Object convertValue(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, T value, Deque<String> path, boolean silently)
      Specified by:
      convertValue in class AvroTypeConverterWithStrictJavaTypeCheck<T>
    • canManage

      public boolean canManage(org.apache.avro.Schema schema, Deque<String> path)
      Description copied from interface: AvroTypeConverter
      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