Interface JsonToAvroReader
- All Known Implementing Classes:
CompositeJsonToAvroReader
public interface JsonToAvroReader
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.avro.generic.GenericData.Recordconvert a Map to a generic recordread(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, Object jsonValue, Deque<String> path, boolean silently) allow to convert a json field to type corresponding avro type
-
Method Details
-
read
org.apache.avro.generic.GenericData.Record read(Map<String, Object> json, org.apache.avro.Schema schema) convert a Map to a generic record- Parameters:
json- the json to convertschema- the avro schema to use- Returns:
- the converted Record
-
read
Object read(org.apache.avro.Schema.Field field, org.apache.avro.Schema schema, Object jsonValue, Deque<String> path, boolean silently) allow to convert a json field to type corresponding avro type- Parameters:
field- the avro field to createschema- the schema associated to the fieldjsonValue- the json jsonValue of the fieldpath- the path of the field on the jsonsilently- should be false to throw an error in case of incompatible java type for the avro type- Returns:
- the converted jsonValue
-