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
Specifies the mapping of an enumeration for serialization/deserialization.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJacksonEnumMapping(Class<T> type) Creates a mapping specification, with no mapping.Creates a mapping specification with mapping. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMapping(String name, T value) Adds a mapping.voidaddToModule(com.fasterxml.jackson.databind.module.SimpleModule module) Ass this mapping to the given module.getType()Returns the enum type.
-
Field Details
-
type
-
mapping
-
-
Constructor Details
-
JacksonEnumMapping
Creates a mapping specification, with no mapping.- Parameters:
type- the type to map
-
JacksonEnumMapping
Creates a mapping specification with mapping.- Parameters:
type- the type to mapmapping- the name-value mapping, may be null
-
-
Method Details
-
addMapping
Description copied from interface:Json.EnumMappingAdds a mapping.- Specified by:
addMappingin interfaceJson.EnumMapping<T>- Parameters:
name- the namevalue- the mapped value
-
getType
Description copied from interface:Json.EnumMappingReturns the enum type.- Specified by:
getTypein interfaceJson.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
-