Class EnumValues

  • All Implemented Interfaces:
    java.io.Serializable

    public final class EnumValues
    extends java.lang.Object
    implements java.io.Serializable
    Helper class used for storing String serializations of Enums, to match to/from external representations.
    See Also:
    Serialized Form
    • Method Detail

      • construct

        public static EnumValues construct​(SerializationConfig config,
                                           java.lang.Class<java.lang.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,
                                                   java.lang.Class<java.lang.Enum<?>> enumClass)
      • constructFromToString

        public static EnumValues constructFromToString​(MapperConfig<?> config,
                                                       java.lang.Class<java.lang.Enum<?>> enumClass)
      • construct

        public static EnumValues construct​(MapperConfig<?> config,
                                           java.lang.Class<java.lang.Enum<?>> enumClass,
                                           java.util.List<java.lang.String> externalValues)
        Since:
        2.11
      • construct

        public static EnumValues construct​(java.lang.Class<java.lang.Enum<?>> enumClass,
                                           SerializableString[] externalValues)
        Since:
        2.11
      • serializedValueFor

        public SerializableString serializedValueFor​(java.lang.Enum<?> key)
      • enums

        public java.util.List<java.lang.Enum<?>> enums()
        Convenience accessor for getting raw Enum instances.
        Since:
        2.6
      • internalMap

        public java.util.EnumMap<?,​SerializableString> internalMap()
        Method used for serialization and introspection by core Jackson code.
      • getEnumClass

        public java.lang.Class<java.lang.Enum<?>> getEnumClass()
        Since:
        2.2