public abstract class BooleanBasedTypeConverter<T> extends java.lang.Object implements TypeConverter<T>
| Constructor and Description |
|---|
BooleanBasedTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
convertToBoolean(T object)
Called to convert a an object of type T into a boolean.
|
abstract T |
getFromBoolean(boolean b)
Called to convert a boolean into an object of type T.
|
T |
parse(com.fasterxml.jackson.core.JsonParser jsonParser)
Called to parse the current object in the jsonParser to an object of type T
|
void |
serialize(T object,
java.lang.String fieldName,
boolean writeFieldNameForObject,
com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
Called to serialize an object of type T to JSON using the JsonGenerator and field name.
|
public abstract T getFromBoolean(boolean b)
b - The boolean parsed from JSON.public abstract boolean convertToBoolean(T object)
object - The object being converted.public T parse(com.fasterxml.jackson.core.JsonParser jsonParser) throws java.io.IOException
TypeConverterparse in interface TypeConverter<T>jsonParser - The JsonParser that is pre-configured for this field.java.io.IOExceptionpublic void serialize(T object, java.lang.String fieldName, boolean writeFieldNameForObject, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws java.io.IOException
TypeConverterserialize in interface TypeConverter<T>object - The object to serializefieldName - The JSON field name of the object when it is serializedwriteFieldNameForObject - If true, you're responsible for calling jsonGenerator.writeFieldName(fieldName) before writing the fieldjsonGenerator - The JsonGenerator object to which the object should be writtenjava.io.IOException