com.fasterxml.jackson.databind.util

## Class EnumValues

- java.lang.Object
- - com.fasterxml.jackson.databind.util.EnumValues

All Implemented Interfaces:
  Serializable

    public final class EnumValues
    extends Object
    implements Serializable

Helper class used for storing String serializations of `Enum`s, to match to/from external representations.

See Also:
  Serialized Form

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`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.
`protected static String` `_findNameToUse(String explicitName, String otherName, boolean toLowerCase)`
`static EnumValues` `construct(Class<Enum<?>> enumClass, 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<?,SerializableString>` `internalMap()` Method used for serialization and introspection by core Jackson code.
`SerializableString` `serializedValueFor(Enum<?> key)`
`Collection<SerializableString>` `values()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### construct

    public 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.

Since:
  2.16

#### constructFromName

    @Deprecated
    public static EnumValues constructFromName(MapperConfig<?> config,
                                                           Class<Enum<?>> enumClass)

Deprecated. Since 2.16, use `constructFromName(MapperConfig, AnnotatedClass)` instead.

#### constructFromName

    public static EnumValues constructFromName(MapperConfig<?> config,
                                               AnnotatedClass annotatedClass)

Since:
  2.16

#### constructFromToString

    public static EnumValues constructFromToString(MapperConfig<?> config,
                                                   AnnotatedClass annotatedClass)

Since:
  2.16

#### constructFromToString

    @Deprecated
    public static EnumValues constructFromToString(MapperConfig<?> config,
                                                               Class<Enum<?>> enumClass)

Deprecated. since 2.16; use `constructFromToString(MapperConfig, AnnotatedClass)` instead

#### constructUsingEnumNamingStrategy

    public static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config,
                                                              AnnotatedClass annotatedClass,
                                                              EnumNamingStrategy namingStrategy)

Returns String serializations of Enum name using an instance of `EnumNamingStrategy`.

The output `EnumValues` should contain values that are symmetric to `EnumResolver.constructUsingEnumNamingStrategy(DeserializationConfig, AnnotatedClass, EnumNamingStrategy)`.

Since:
  2.16

#### constructUsingEnumNamingStrategy

    @Deprecated
    public static EnumValues constructUsingEnumNamingStrategy(MapperConfig<?> config,
                                                                          Class<Enum<?>> enumClass,
                                                                          EnumNamingStrategy namingStrategy)

Deprecated. Since 2.16; use `constructUsingEnumNamingStrategy(MapperConfig, AnnotatedClass, EnumNamingStrategy)` instead.
Returns String serializations of Enum name using an instance of `EnumNamingStrategy`. The output `EnumValues` should contain values that are symmetric to `EnumResolver.constructUsingEnumNamingStrategy(DeserializationConfig, AnnotatedClass, EnumNamingStrategy)`.

Since:
  2.15

#### construct

    public static EnumValues construct(MapperConfig<?> config,
                                       Class<Enum<?>> enumClass,
                                       List<String> externalValues)

Since:
  2.11

#### construct

    public static EnumValues construct(Class<Enum<?>> enumClass,
                                       SerializableString[] externalValues)

Since:
  2.11

#### _enumClass

    protected static Class<Enum<?>> _enumClass(Class<?> enumCls0)

#### _enumConstants

    protected static Enum<?>[] _enumConstants(Class<?> enumCls)

Helper method slightly different from `EnumResolver._enumConstants(Class)`, with same method name to keep calling methods more consistent.

#### _findNameToUse

    protected static String _findNameToUse(String explicitName,
                                           String otherName,
                                           boolean toLowerCase)

#### serializedValueFor

    public SerializableString serializedValueFor(Enum<?> key)

#### values

    public Collection<SerializableString> values()

#### enums

    public List<Enum<?>> enums()

Convenience accessor for getting raw Enum instances.

Since:
  2.6

#### internalMap

    public EnumMap<?,SerializableString> internalMap()

Method used for serialization and introspection by core Jackson code.

#### getEnumClass

    public Class<Enum<?>> getEnumClass()

Since:
  2.2