Package eu.woolplatform.utils.json
Class EnumCustomStringDeserializer<T extends Enum<?>>
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<T>
-
- eu.woolplatform.utils.json.EnumCustomStringDeserializer<T>
-
- Type Parameters:
T- the enum type
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class EnumCustomStringDeserializer<T extends Enum<?>> extends com.fasterxml.jackson.databind.JsonDeserializer<T>This deserializer can read a string value or null and convert it to an enum using a static method T fromStringValue().
-
-
Constructor Summary
Constructors Constructor Description EnumCustomStringDeserializer(Class<T> enumClass)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdeserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Method Detail
-
deserialize
public T deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<T extends Enum<?>>- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
-