Class EnumResolver
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.util.EnumResolver
- All Implemented Interfaces:
Serializable
Helper class used to resolve String values (either JSON Object field
names or regular String values) into Java Enum instances.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Enum<?>
protected final Enum<?>[]
protected final boolean
Marker for case where value may come from@JsonValue
annotated accessor and is expected/likely to come from actual integral number value (and not String).protected final boolean
Marker for case-insensitive handling -
Constructor Summary
ModifierConstructorDescriptionprotected
EnumResolver
(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue) Deprecated.Since 2.12 (remove from 2.13+ not part of public API)protected
EnumResolver
(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase) Deprecated.Since 2.13protected
EnumResolver
(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase, boolean isFromIntValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected static EnumResolver
_constructFor
(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase) protected static EnumResolver
_constructUsingMethod
(Class<?> enumCls0, AnnotatedMember accessor, AnnotationIntrospector ai, boolean isIgnoreCase) protected static EnumResolver
_constructUsingToString
(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase) _enumClass
(Class<?> enumCls0) protected static Enum<?>[]
_enumConstants
(Class<?> enumCls) protected static Enum<?>
_enumDefault
(AnnotationIntrospector intr, Class<?> enumCls) protected Enum<?>
protected static boolean
_isIntType
(Class<?> erasedType) static EnumResolver
constructFor
(DeserializationConfig config, Class<?> enumCls) Factory method for constructing resolver that maps from Enum.name() into Enum value.static EnumResolver
constructFor
(Class<Enum<?>> enumCls, AnnotationIntrospector ai) Deprecated.Since 2.12static EnumResolver
constructUnsafe
(Class<?> rawEnumCls, AnnotationIntrospector ai) Deprecated.Since 2.12static EnumResolver
constructUnsafeUsingMethod
(Class<?> rawEnumCls, AnnotatedMember accessor, AnnotationIntrospector ai) Deprecated.Since 2.12static EnumResolver
constructUnsafeUsingToString
(Class<?> rawEnumCls, AnnotationIntrospector ai) Deprecated.Since 2.12static EnumResolver
constructUsingMethod
(DeserializationConfig config, Class<?> enumCls, AnnotatedMember accessor) Method used when actual String serialization is indicated using @JsonValue on a method in Enum class.static EnumResolver
constructUsingMethod
(Class<Enum<?>> enumCls, AnnotatedMember accessor, AnnotationIntrospector ai) Deprecated.Since 2.12static EnumResolver
constructUsingToString
(DeserializationConfig config, Class<?> enumCls) Factory method for constructing resolver that maps from Enum.toString() into Enum valuestatic EnumResolver
constructUsingToString
(Class<Enum<?>> enumCls) Deprecated.Since 2.8 (remove from 2.13 or later)static EnumResolver
constructUsingToString
(Class<Enum<?>> enumCls, AnnotationIntrospector ai) Deprecated.Since 2.12Enum<?>
Enum<?>
Enum<?>
getEnum
(int index) getEnums()
Enum<?>[]
boolean
Accessor for checking if we have a special case in which value to map is from@JsonValue
annotated accessor with integral type: this matters for cases where incoming content value is of integral type and should be mapped to specific value and NOT toEnum.index()
.int
-
Field Details
-
_enumClass
-
_enums
-
_enumsById
-
_defaultValue
-
_isIgnoreCase
protected final boolean _isIgnoreCaseMarker for case-insensitive handling- Since:
- 2.12
-
_isFromIntValue
protected final boolean _isFromIntValueMarker for case where value may come from@JsonValue
annotated accessor and is expected/likely to come from actual integral number value (and not String).Special case is needed since this specifically means that
Enum.index()
should NOT be used or default to.- Since:
- 2.13
-
-
Constructor Details
-
EnumResolver
protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase, boolean isFromIntValue) - Since:
- 2.12
-
EnumResolver
@Deprecated protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase) Deprecated.Since 2.13 -
EnumResolver
@Deprecated protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String, Enum<?>> map, Enum<?> defaultValue) Deprecated.Since 2.12 (remove from 2.13+ not part of public API)
-
-
Method Details
-
constructFor
Factory method for constructing resolver that maps from Enum.name() into Enum value.- Since:
- 2.12
-
_constructFor
protected static EnumResolver _constructFor(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase) - Since:
- 2.12
-
constructUsingToString
Factory method for constructing resolver that maps from Enum.toString() into Enum value- Since:
- 2.12
-
_constructUsingToString
protected static EnumResolver _constructUsingToString(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase) - Since:
- 2.12
-
constructUsingMethod
public static EnumResolver constructUsingMethod(DeserializationConfig config, Class<?> enumCls, AnnotatedMember accessor) Method used when actual String serialization is indicated using @JsonValue on a method in Enum class.- Since:
- 2.12
-
_constructUsingMethod
protected static EnumResolver _constructUsingMethod(Class<?> enumCls0, AnnotatedMember accessor, AnnotationIntrospector ai, boolean isIgnoreCase) - Since:
- 2.12
-
constructLookup
-
_enumClass
-
_enumConstants
-
_enumDefault
-
_isIntType
-
constructFor
@Deprecated public static EnumResolver constructFor(Class<Enum<?>> enumCls, AnnotationIntrospector ai) Deprecated.Since 2.12 -
constructUnsafe
@Deprecated public static EnumResolver constructUnsafe(Class<?> rawEnumCls, AnnotationIntrospector ai) Deprecated.Since 2.12 -
constructUsingToString
@Deprecated public static EnumResolver constructUsingToString(Class<Enum<?>> enumCls, AnnotationIntrospector ai) Deprecated.Since 2.12 -
constructUnsafeUsingToString
@Deprecated public static EnumResolver constructUnsafeUsingToString(Class<?> rawEnumCls, AnnotationIntrospector ai) Deprecated.Since 2.12- Since:
- 2.8
-
constructUsingToString
Deprecated.Since 2.8 (remove from 2.13 or later) -
constructUsingMethod
@Deprecated public static EnumResolver constructUsingMethod(Class<Enum<?>> enumCls, AnnotatedMember accessor, AnnotationIntrospector ai) Deprecated.Since 2.12 -
constructUnsafeUsingMethod
@Deprecated public static EnumResolver constructUnsafeUsingMethod(Class<?> rawEnumCls, AnnotatedMember accessor, AnnotationIntrospector ai) Deprecated.Since 2.12- Since:
- 2.9
-
findEnum
-
_findEnumCaseInsensitive
-
getEnum
-
getDefaultValue
-
getRawEnums
-
getEnums
-
getEnumIds
- Since:
- 2.7.3
-
getEnumClass
-
lastValidIndex
public int lastValidIndex() -
isFromIntValue
public boolean isFromIntValue()Accessor for checking if we have a special case in which value to map is from@JsonValue
annotated accessor with integral type: this matters for cases where incoming content value is of integral type and should be mapped to specific value and NOT toEnum.index()
.- Since:
- 2.13
-