Interface ObjectSerializer<T extends Serializable>
- Type Parameters:
T
- the type of the serialized form
- All Known Implementing Classes:
GsonObjectSerializer
public interface ObjectSerializer<T extends Serializable>
A serializer of objects, i.e., a class that can convert an arbitrary object to a serialized form and back.
- Author:
- RealLifeDeveloper
-
Method Summary
-
Method Details
-
serialize
Converts an object to its serialized form.The implementation should support serializing
null
values.- Parameters:
object
- the object to serialize, can benull
- Returns:
- the serialized representation of
object
-
deserialize
Given the serialized representation of an object, converts it back to the object.- Type Parameters:
U
- the type of the object- Parameters:
serializedObject
- the serialized form of an objectobjectType
- the concrete class of the serialized object- Returns:
- the object represented by
serializedObject
- Throws:
IllegalArgumentException
- if any argument isnull
-