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[]>

public class AlertSerializer extends Object implements Serializer<Alert>
A simple, generic alert event serializer.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final de.iip_ecosphere.platform.support.json.Json
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    clone(Alert origin)
    Creates a new value instance and copies the values from origin to the new instance.
    from(byte[] data)
    Deserializes a target value into a source value ("input from external").
    The type to be handled by this serializer.
    byte[]
    to(Alert source)
    Translates a source value into a target value ("output to external").

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAPPER

      private static final de.iip_ecosphere.platform.support.json.Json MAPPER
  • Constructor Details

    • AlertSerializer

      public AlertSerializer()
  • Method Details

    • from

      public Alert from(byte[] data) throws IOException
      Description copied from interface: InputTypeTranslator
      Deserializes a target value into a source value ("input from external").
      Specified by:
      from in interface InputTypeTranslator<byte[],Alert>
      Parameters:
      data - the data to be translated back
      Returns:
      the serialized object
      Throws:
      IOException - in case that serialization fails
    • to

      public byte[] to(Alert source) throws IOException
      Description copied from interface: OutputTypeTranslator
      Translates a source value into a target value ("output to external").
      Specified by:
      to in interface OutputTypeTranslator<Alert,byte[]>
      Parameters:
      source - the source value to be translated
      Returns:
      the target value
      Throws:
      IOException - in case that translation fails
    • clone

      public Alert clone(Alert origin) throws IOException
      Description copied from interface: Serializer
      Creates a new value instance and copies the values from origin to the new instance. Use the SerializerRegistry to implement cloning of nested object values.
      Specified by:
      clone in interface Serializer<Alert>
      Parameters:
      origin - the object to clone
      Returns:
      the cloned object
      Throws:
      IOException - in case that cloning/serialization operations fail
    • getType

      public Class<Alert> getType()
      Description copied from interface: Serializer
      The type to be handled by this serializer.
      Specified by:
      getType in interface Serializer<Alert>
      Returns:
      the type