public abstract class AbstractXStreamPersister<K extends Key,V> extends Object implements XStreamObjectPersister<K,V>
Modifier | Constructor and Description |
---|---|
protected |
AbstractXStreamPersister(com.thoughtworks.xstream.XStream xStream,
Supplier<File> storageDirectorySupplier,
Function<? super V,K> keyGenerator,
Class<V> persistedClass) |
Modifier and Type | Method and Description |
---|---|
void |
cleanStorage()
Remove all persisted objects
|
V |
load(K key)
Load object from the storage
|
Iterable<Pair<K,V>> |
loadAndRemoveAll()
Lazily loads all stored objects and removes files from storage.
|
void |
remove(K key)
Remove object identified by key from the storage
|
void |
save(V objectToBePersisted,
boolean saveEvenIfFileExists)
Save
CurrentlyBuilding in the storage |
protected File |
storageFile(K key)
Create storage file for persisting object
|
protected File |
temporaryFile(K key)
Create temporary file for persisting object
|
@NotNull public V load(@NotNull K key)
XStreamObjectPersister
load
in interface XStreamObjectPersister<K extends Key,V>
public void save(@NotNull V objectToBePersisted, boolean saveEvenIfFileExists)
XStreamObjectPersister
CurrentlyBuilding
in the storagesave
in interface XStreamObjectPersister<K extends Key,V>
public void remove(@NotNull K key)
XStreamObjectPersister
remove
in interface XStreamObjectPersister<K extends Key,V>
public void cleanStorage()
XStreamObjectPersister
cleanStorage
in interface XStreamObjectPersister<K extends Key,V>
@NotNull public Iterable<Pair<K,V>> loadAndRemoveAll()
XStreamObjectPersister
loadAndRemoveAll
in interface XStreamObjectPersister<K extends Key,V>
protected File temporaryFile(@NotNull K key)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.