public final class EnumValues extends Object implements Serializable
Enum
s,
to match to/from external representations.Modifier and Type | Method and Description |
---|---|
protected static Class<Enum<?>> |
_enumClass(Class<?> enumCls0) |
protected static Enum<?>[] |
_enumConstants(Class<?> enumCls)
Helper method slightly different from
EnumResolver._enumConstants(Class) ,
with same method name to keep calling methods more consistent. |
static EnumValues |
construct(Class<Enum<?>> enumClass,
com.fasterxml.jackson.core.SerializableString[] externalValues) |
static EnumValues |
construct(MapperConfig<?> config,
Class<Enum<?>> enumClass,
List<String> externalValues) |
static EnumValues |
construct(SerializationConfig config,
AnnotatedClass annotatedClass)
NOTE: do NOT call this if configuration may change, and choice between toString()
and name() might change dynamically.
|
static EnumValues |
constructFromName(MapperConfig<?> config,
AnnotatedClass annotatedClass) |
static EnumValues |
constructFromName(MapperConfig<?> config,
Class<Enum<?>> enumClass)
Deprecated.
Since 2.16, use
constructFromName(MapperConfig, AnnotatedClass) instead. |
static EnumValues |
constructFromToString(MapperConfig<?> config,
AnnotatedClass annotatedClass) |
static EnumValues |
constructFromToString(MapperConfig<?> config,
Class<Enum<?>> enumClass)
Deprecated.
since 2.16; use
constructFromToString(MapperConfig, AnnotatedClass) instead |
static EnumValues |
constructUsingEnumNamingStrategy(MapperConfig<?> config,
AnnotatedClass annotatedClass,
EnumNamingStrategy namingStrategy)
Returns String serializations of Enum name using an instance of
EnumNamingStrategy . |
static EnumValues |
constructUsingEnumNamingStrategy(MapperConfig<?> config,
Class<Enum<?>> enumClass,
EnumNamingStrategy namingStrategy)
Deprecated.
Since 2.16; use
constructUsingEnumNamingStrategy(MapperConfig, AnnotatedClass, EnumNamingStrategy) instead. |
List<Enum<?>> |
enums()
Convenience accessor for getting raw Enum instances.
|
Class<Enum<?>> |
getEnumClass() |
EnumMap<?,com.fasterxml.jackson.core.SerializableString> |
internalMap()
Method used for serialization and introspection by core Jackson code.
|
com.fasterxml.jackson.core.SerializableString |
serializedValueFor(Enum<?> key) |
Collection<com.fasterxml.jackson.core.SerializableString> |
values() |
public static EnumValues construct(SerializationConfig config, AnnotatedClass annotatedClass)
@Deprecated public static EnumValues constructFromName(MapperConfig<?> config, Class<Enum<?>> enumClass)
constructFromName(MapperConfig, AnnotatedClass)
instead.public static EnumValues constructFromName(MapperConfig<?> config, AnnotatedClass annotatedClass)
public static EnumValues constructFromToString(MapperConfig<?> config, AnnotatedClass annotatedClass)
@Deprecated public static EnumValues constructFromToString(MapperConfig<?> config, Class<Enum<?>> enumClass)
constructFromToString(MapperConfig, AnnotatedClass)
insteadpublic static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config, AnnotatedClass annotatedClass, EnumNamingStrategy namingStrategy)
EnumNamingStrategy
.
The output EnumValues
should contain values that are symmetric to
EnumResolver.constructUsingEnumNamingStrategy(DeserializationConfig, AnnotatedClass, EnumNamingStrategy)
.
@Deprecated public static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config, Class<Enum<?>> enumClass, EnumNamingStrategy namingStrategy)
constructUsingEnumNamingStrategy(MapperConfig, AnnotatedClass, EnumNamingStrategy)
instead.EnumNamingStrategy
.
The output EnumValues
should contain values that are symmetric to
EnumResolver.constructUsingEnumNamingStrategy(DeserializationConfig, AnnotatedClass, EnumNamingStrategy)
.public static EnumValues construct(MapperConfig<?> config, Class<Enum<?>> enumClass, List<String> externalValues)
public static EnumValues construct(Class<Enum<?>> enumClass, com.fasterxml.jackson.core.SerializableString[] externalValues)
protected static Enum<?>[] _enumConstants(Class<?> enumCls)
EnumResolver._enumConstants(Class)
,
with same method name to keep calling methods more consistent.public com.fasterxml.jackson.core.SerializableString serializedValueFor(Enum<?> key)
public Collection<com.fasterxml.jackson.core.SerializableString> values()
public EnumMap<?,com.fasterxml.jackson.core.SerializableString> internalMap()
Copyright © 2008–2023 FasterXML. All rights reserved.