Class OSBadBooleanDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<Boolean>
-
- org.openstack4j.core.transport.internal.OSBadBooleanDeserializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class OSBadBooleanDeserializer extends com.fasterxml.jackson.databind.JsonDeserializer<Boolean>
Openstack API V2 has a few Services which return a 'True' as a boolean value. Jackson typically will not realize that this is equivalent to 'true' and will throw an error. This Deserializer is a workaround to both problems- Author:
- Jeremy Unruh
-
-
Constructor Summary
Constructors Constructor Description OSBadBooleanDeserializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean_parseBooleanFromNumber(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt)_parse boolean from number.Booleandeserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt)-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Method Detail
-
deserialize
public Boolean deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<Boolean>- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
_parseBooleanFromNumber
protected final boolean _parseBooleanFromNumber(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException_parse boolean from number.- Parameters:
jp- the jpctxt- the ctxt- Returns:
- true, if successful
- Throws:
IOException- Signals that an I/O exception has occurred.com.fasterxml.jackson.core.JsonProcessingException- the json processing exception
-
-