public interface IIdentifiable {
public long getId();
}
public interface IState extends IIdentifiable {
public byte[] toByteArray();
public void assignFromByteArray(byte[] bytes);
}
public interface IManageState {
// linkable component state management
public IState keepCurrentState();
public void restoreState(IState state);
public void clearState(IState state);
// TODO: decide if states should be publically visible
public IState[]Collection<IState> getStates();
// factory method to revive state
public IState createStateFromByteArray(byte[] bytes);
}
|