-
- 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<T>
getModelClass()
Returns the model's java classT
read(DataInputStream in)
Deserialize a model from an input stream.void
write(T model, DataOutputStream out)
Serialize a model to an output stream.
-
-
-
Method Detail
-
getModelClass
Class<T> getModelClass()
Returns the model's java class- Returns:
- the model's java class
-
read
T read(DataInputStream in) throws IOException
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
void write(T model, DataOutputStream out) throws IOException
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
-
-