public class BytesDecimalConverter extends java.lang.Object implements AvroTypeConverter
AvroTypeConverter.Incompatible| Modifier and Type | Field and Description |
|---|---|
static AvroTypeConverter |
INSTANCE |
| Constructor and Description |
|---|
BytesDecimalConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected java.math.BigDecimal |
bigDecimalWithExpectedScale(java.lang.String decimal,
int scale,
java.util.Deque<java.lang.String> path) |
boolean |
canManage(org.apache.avro.Schema schema,
java.util.Deque<java.lang.String> deque)
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 value,
java.util.Deque<java.lang.String> path,
boolean silently)
convert the json jsonValue to the avro jsonValue
|
protected java.lang.Object |
convertDecimal(java.lang.Object value,
int scale,
java.util.Deque<java.lang.String> path) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisLogicalTypepublic static final AvroTypeConverter INSTANCE
public java.lang.Object convert(org.apache.avro.Schema.Field field,
org.apache.avro.Schema schema,
java.lang.Object value,
java.util.Deque<java.lang.String> path,
boolean silently)
AvroTypeConverterconvert in interface AvroTypeConverterfield - the field to convertschema - the schema of the fieldvalue - the json jsonValuepath - the path of the fieldsilently - should be false to throw an error in case of incompatible java type for the avro typeprotected java.lang.Object convertDecimal(java.lang.Object value,
int scale,
java.util.Deque<java.lang.String> path)
protected java.math.BigDecimal bigDecimalWithExpectedScale(java.lang.String decimal,
int scale,
java.util.Deque<java.lang.String> path)
public boolean canManage(org.apache.avro.Schema schema,
java.util.Deque<java.lang.String> deque)
AvroTypeConvertercanManage in interface AvroTypeConverterschema - the avro schema in which to convert the jsondeque - the path of the current field. Can be used to define a specific converter for a path