- Type Parameters:
T- the model type
- All Known Implementing Classes:
SerializableModelStorageHandler
public interface ModelStorageHandler<T>
A model storage handler is responsible for handling the persistence of
a model object.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the model's java classread(DataInputStream in) Deserialize a model from an input stream.voidwrite(T model, DataOutputStream out) Serialize a model to an output stream.
-
Method Details
-
getModelClass
Returns the model's java class- Returns:
- the model's java class
-
read
Deserialize a model from an input stream. This implementation should be symmetric with that ofwrite(T, java.io.DataOutputStream).- Parameters:
in- the input stream.- Returns:
- the model object
- Throws:
IOException
-
write
Serialize a model to an output stream. This implementation should be symmetric with that ofread(java.io.DataInputStream).- Parameters:
model- the model objectout- the output stream- Throws:
IOException
-