Interface SharableSerializer<T>

Type Parameters:
T - The type of data the Sharable this belongs to represents.

public interface SharableSerializer<T>
This represents how a Sharable's data will be serialized/deserialized.
  • Method Summary

    Modifier and Type
    Method
    Description
    This deserializes the data for a Sharable.
    This serializes the data for a Sharable.
  • Method Details

    • deserialize

      T deserialize(Object obj)
      This deserializes the data for a Sharable. You must be expecting the type of data coming in in order to process this. That type will generally be the type that this serializes as with serialize(Object).
      Parameters:
      obj - The incoming (serialized) data to be deserialized.
      Returns:
      The data represented by the Sharable this object represents in deserialized form.
    • serialize

      Object serialize(T t)
      This serializes the data for a Sharable. The output is an Object but what you return is up to you, however, this is limited by the constraints of the persistence method. Generally, returning a String is the safest way to serialize your data. Most boxed primitives are accepted as well as Lists of boxed primitives and Map<String, Object>.
      Parameters:
      t - The value of the data represented by the Sharable.
      Returns:
      The serialized form of the data.