Interface SharableSerializer<T>
- Type Parameters:
T
- The type of data theSharable
this belongs to represents.
public interface SharableSerializer<T>
This represents how a Sharable's data will be serialized/deserialized.
-
Method Summary
-
Method Details
-
deserialize
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 withserialize(Object)
.- Parameters:
obj
- The incoming (serialized) data to be deserialized.- Returns:
- The data represented by the Sharable this object represents in deserialized form.
-
serialize
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 andMap
<String
,Object
>.- Parameters:
t
- The value of the data represented by the Sharable.- Returns:
- The serialized form of the data.
-