Caplin Trader 4.7.1

Interface: module:br/component/Serializable

module:br/component/Serializable

The Serializable interface is implemented by classes that provide a mechanism to serialize their state and recreate instances from a serialized form.

The only restriction on the serialized form is that it is a string. A class may change its serialized form, however if it does so and wishes to maintain backwards compatibility with current serialized forms, it will need the deserialize method to cope with multiple different versions of serialized form. For this reason, it's good practice to put the serialization version at the beginning of the serialized form.

It is not the responsibility of a Serializable class to include its classname in its serialized form.

Methods

(static) deserialize(serializedForm)

Parameters:
Name Type Description
serializedForm string a string representation of the state of a component. May not be null.
Returns:
a newly created instance of this class that has a state matching this serialized form.

serialize()

Returns:
a string representation of the current state of this component. May not be null.