public class PersistenceFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
STORAGE_FOLDER |
| Constructor and Description |
|---|
PersistenceFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(String name) |
<T extends Storable<R>,R> |
init(String name,
T initial)
Init new persistent system.
|
<T extends Storable<R>,R> |
initOptional(String name,
java.util.function.Supplier<T> supplier)
Init new system or load from disk if already exists save.
|
<T extends Storable<R>,R> |
load(String name)
Init previously stored system.
|
public static final String STORAGE_FOLDER
public <T extends Storable<R>,R> PersistenceController<T,R> load(String name)
T - Mutable interface of systemR - Immutable view of systemname - name of automatically created folder (to store jounal and
snapshots)public <T extends Storable<R>,R> PersistenceController<T,R> init(String name, T initial)
T - Mutable interface of systemR - Immutable view of systemname - name of automatically created folder (to store jounal and
snapshots)public <T extends Storable<R>,R> PersistenceController<T,R> initOptional(String name, java.util.function.Supplier<T> supplier)
T - Mutable interface of systemR - Immutable view of systemname - name of automatically created folder (to store jounal and
snapshots)supplier - factory creating initial state of system (if nothing was
saved)public boolean exists(String name)
Copyright © 2015. All rights reserved.