public class StatusMessageSerializer extends Object implements Serializer<StatusMessage>
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
StatusMessageSerializer.EnumDeserializer<T>
Generic enum deserializer.
|
| Modifier and Type | Field and Description |
|---|---|
private static Map<String,ActionType> |
ACTION_CONSTANTS |
private static Map<String,ComponentType> |
COMPONENT_CONSTANTS |
private static com.fasterxml.jackson.databind.module.SimpleModule |
MODULE |
| Constructor and Description |
|---|
StatusMessageSerializer() |
| Modifier and Type | Method and Description |
|---|---|
StatusMessage |
clone(StatusMessage origin)
Creates a new value instance and copies the values from
origin to the new instance. |
StatusMessage |
from(byte[] data)
Deserializes a target value into a source value ("input from external").
|
Class<StatusMessage> |
getType()
The type to be handled by this serializer.
|
private static <T> void |
register(Class<? extends T> cls,
Map<String,T> mapping)
Does the registration of
cls as enum constant and modifies mapping as side effect. |
static void |
registerActions(Class<? extends ActionType> type)
Registers custom action types.
|
static void |
registerComponents(Class<? extends ComponentType> type)
Registers custom component types.
|
byte[] |
to(StatusMessage source)
Translates a source value into a target value ("output to external").
|
private static final com.fasterxml.jackson.databind.module.SimpleModule MODULE
private static final Map<String,ActionType> ACTION_CONSTANTS
private static final Map<String,ComponentType> COMPONENT_CONSTANTS
public static void registerActions(Class<? extends ActionType> type)
type - the type to registerpublic static void registerComponents(Class<? extends ComponentType> type)
type - the type to registerprivate static <T> void register(Class<? extends T> cls, Map<String,T> mapping)
cls as enum constant and modifies mapping as side effect.T - the "enum" typecls - the typemapping - the mapping to be modified as side effectpublic StatusMessage from(byte[] data) throws IOException
InputTypeTranslatorfrom in interface InputTypeTranslator<byte[],StatusMessage>data - the data to be translated backIOException - in case that serialization failspublic byte[] to(StatusMessage source) throws IOException
OutputTypeTranslatorto in interface OutputTypeTranslator<StatusMessage,byte[]>source - the source value to be translatedIOException - in case that translation failspublic StatusMessage clone(StatusMessage origin) throws IOException
Serializerorigin to the new instance.
Use the SerializerRegistry to implement cloning of nested object values.clone in interface Serializer<StatusMessage>origin - the object to cloneIOException - in case that cloning/serialization operations failpublic Class<StatusMessage> getType()
SerializergetType in interface Serializer<StatusMessage>Copyright © 2022. All rights reserved.