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
    Modifier and Type | Method and Description
    --- | ---
    `static EnumValues` | `construct(Class<Enum<?>> enumClass, SerializableString[] externalValues)`
    `static EnumValues` | `construct(MapperConfig<?> config, Class<Enum<?>> enumClass, List<String> externalValues)`
    `static EnumValues` | `construct(SerializationConfig config, Class<Enum<?>> enumClass)` NOTE: do NOT call this if configuration may change, and choice between toString() and name() might change dynamically.
    `static EnumValues` | `constructFromName(MapperConfig<?> config, Class<Enum<?>> enumClass)`
    `static EnumValues` | `constructFromToString(MapperConfig<?> config, Class<Enum<?>> enumClass)`
    `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,
                                             Class<Enum<?>> enumClass)

      NOTE: do NOT call this if configuration may change, and choice between toString() and name() might change dynamically.

    - #### constructFromName

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

    - #### constructFromToString

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

    - #### 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

    - #### 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

Copyright © 2008–2020 FasterXML. All rights reserved.