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
-
Nested Class Summary
Nested classes/interfaces inherited from interface tech.allegro.schema.json2avro.converter.types.AvroTypeConverter
AvroTypeConverter.Incompatible -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAvroTypeConverterWithStrictJavaTypeCheck(Class<T> javaType) -
Method Summary
Modifier and TypeMethodDescriptionconvert(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 jsonValueabstract ObjectconvertValue(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, T value, Deque<String> path, boolean silently) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tech.allegro.schema.json2avro.converter.types.AvroTypeConverter
canManage
-
Constructor Details
-
AvroTypeConverterWithStrictJavaTypeCheck
-
-
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:AvroTypeConverterconvert the json jsonValue to the avro jsonValue- Specified by:
convertin interfaceAvroTypeConverter- 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
-
convertValue
-