T - the type of object serialized into the filepublic class MemoryBackedObject<T extends Serializable> extends Object implements PersistenceBackedObject<T>
NOTE: Use this class with care as it does not provide a fresh deserialized copy of the data provided,
| Constructor and Description |
|---|
MemoryBackedObject(Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Returns whether the intended persistence location is already populated.
|
String |
getPath()
Returns the path to the intended persistence location.
|
T |
newInstance(TreeLogger logger)
Constructs and returns a new instance of the object stored at the path.
|
void |
set(TreeLogger logger,
T object)
Serializes the provided object to the intended path.
|
String |
toString() |
public boolean exists()
PersistenceBackedObjectexists in interface PersistenceBackedObject<T extends Serializable>public String getPath()
PersistenceBackedObjectgetPath in interface PersistenceBackedObject<T extends Serializable>public T newInstance(TreeLogger logger) throws UnableToCompleteException
PersistenceBackedObjectnewInstance in interface PersistenceBackedObject<T extends Serializable>UnableToCompleteException - if the backing store does not contain an object of type
Tpublic void set(TreeLogger logger, T object) throws IllegalStateException, UnableToCompleteException
PersistenceBackedObjectset in interface PersistenceBackedObject<T extends Serializable>UnableToCompleteException - if the object could not be serializedIllegalStateExceptionCopyright © 2018. All rights reserved.