Class AlertSerializer
java.lang.Object
de.iip_ecosphere.platform.transport.status.AlertSerializer
- All Implemented Interfaces:
InputTypeTranslator<byte[],,Alert> OutputTypeTranslator<Alert,,byte[]> Serializer<Alert>,TypeTranslator<Alert,byte[]>
A simple, generic alert event serializer.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final de.iip_ecosphere.platform.support.json.Json -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new value instance and copies the values fromoriginto the new instance.from(byte[] data) Deserializes a target value into a source value ("input from external").getType()The type to be handled by this serializer.byte[]Translates a source value into a target value ("output to external").
-
Field Details
-
MAPPER
private static final de.iip_ecosphere.platform.support.json.Json MAPPER
-
-
Constructor Details
-
AlertSerializer
public AlertSerializer()
-
-
Method Details
-
from
Description copied from interface:InputTypeTranslatorDeserializes a target value into a source value ("input from external").- Specified by:
fromin interfaceInputTypeTranslator<byte[],Alert> - Parameters:
data- the data to be translated back- Returns:
- the serialized object
- Throws:
IOException- in case that serialization fails
-
to
Description copied from interface:OutputTypeTranslatorTranslates a source value into a target value ("output to external").- Specified by:
toin interfaceOutputTypeTranslator<Alert,byte[]> - Parameters:
source- the source value to be translated- Returns:
- the target value
- Throws:
IOException- in case that translation fails
-
clone
Description copied from interface:SerializerCreates a new value instance and copies the values fromoriginto the new instance. Use theSerializerRegistryto implement cloning of nested object values.- Specified by:
clonein interfaceSerializer<Alert>- Parameters:
origin- the object to clone- Returns:
- the cloned object
- Throws:
IOException- in case that cloning/serialization operations fail
-
getType
Description copied from interface:SerializerThe type to be handled by this serializer.- Specified by:
getTypein interfaceSerializer<Alert>- Returns:
- the type
-