Class JsonUtils.JacksonEnumMapping<T>

java.lang.Object
de.iip_ecosphere.platform.support.json.JsonUtils.JacksonEnumMapping<T>
Type Parameters:
T - the enumeration type to map
All Implemented Interfaces:
Json.EnumMapping<T>
Enclosing class:
JsonUtils

public static class JsonUtils.JacksonEnumMapping<T> extends Object implements Json.EnumMapping<T>
Specifies the mapping of an enumeration for serialization/deserialization.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • JacksonEnumMapping

      public JacksonEnumMapping(Class<T> type)
      Creates a mapping specification, with no mapping.
      Parameters:
      type - the type to map
    • JacksonEnumMapping

      public JacksonEnumMapping(Class<T> type, Map<String,T> mapping)
      Creates a mapping specification with mapping.
      Parameters:
      type - the type to map
      mapping - the name-value mapping, may be null
  • Method Details

    • addMapping

      public void addMapping(String name, T value)
      Description copied from interface: Json.EnumMapping
      Adds a mapping.
      Specified by:
      addMapping in interface Json.EnumMapping<T>
      Parameters:
      name - the name
      value - the mapped value
    • getType

      public Class<T> getType()
      Description copied from interface: Json.EnumMapping
      Returns the enum type.
      Specified by:
      getType in interface Json.EnumMapping<T>
      Returns:
      the enum type
    • addToModule

      public void addToModule(com.fasterxml.jackson.databind.module.SimpleModule module)
      Ass this mapping to the given module.
      Parameters:
      module - the target module