public class UnionConverter extends java.lang.Object implements AvroTypeConverter
AvroTypeConverter.Incompatible| Constructor and Description |
|---|
UnionConverter(JsonToAvroReader jsonToAvroReader) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canManage(org.apache.avro.Schema schema,
java.util.Deque<java.lang.String> path)
used to know if this class can convert the json value to the avro value
|
java.lang.Object |
convert(org.apache.avro.Schema.Field field,
org.apache.avro.Schema schema,
java.lang.Object jsonValue,
java.util.Deque<java.lang.String> path,
boolean silently)
convert the json jsonValue to the avro jsonValue
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisLogicalTypepublic UnionConverter(JsonToAvroReader jsonToAvroReader)
public java.lang.Object convert(org.apache.avro.Schema.Field field,
org.apache.avro.Schema schema,
java.lang.Object jsonValue,
java.util.Deque<java.lang.String> path,
boolean silently)
AvroTypeConverterconvert in interface AvroTypeConverterfield - 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 typepublic boolean canManage(org.apache.avro.Schema schema,
java.util.Deque<java.lang.String> path)
AvroTypeConvertercanManage in interface AvroTypeConverterschema - 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