Package com.google.cloud
Interface Restorable<T extends Restorable<T>>
-
- Type Parameters:
T
- the restorable object's type
- All Known Subinterfaces:
ReadChannel
,WriteChannel
- All Known Implementing Classes:
BaseWriteChannel
public interface Restorable<T extends Restorable<T>>
Implementation of this interface can persist their state and restore from it.A typical capture usage:
X restorableObj; // X instanceof Restorable<X> RestorableState<X> state = restorableObj.capture(); .. persist state
A typical restore usage:
RestorableState<X> state = ... // read from persistence X restorableObj = state.restore(); ...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestorableState<T>
capture()
Captures the state of this object.
-
-
-
Method Detail
-
capture
RestorableState<T> capture()
Captures the state of this object.- Returns:
- a
RestorableState
instance that contains the state for this object and can restore it afterwards.
-
-