public interface DBContext extends Closeable
Update.
Example usage:
Ability.builder().action(ctx -> {db.getSet(USERS); doSomething();})*
AbilityBot contains a handle on the db that the user can use inside his declared abilities.| Modifier and Type | Method and Description |
|---|---|
Object |
backup()
Implementations of this method are free to return any object such as XML, JSON, etc...
|
void |
clear()
Clears the data structures present in the database.
|
void |
commit()
Commits the database to its persistent layer.
|
boolean |
contains(String name) |
<T> List<T> |
getList(String name) |
<K,V> Map<K,V> |
getMap(String name) |
<T> Set<T> |
getSet(String name) |
String |
info(String name) |
boolean |
recover(Object backup)
The object passed to this method need to conform to the implementation of the
backup() method. |
String |
summary() |
<T> List<T> getList(String name)
T - the type that the List holdsname - the unique name of the List<K,V> Map<K,V> getMap(String name)
K - the type of the Map keysV - the type of the Map valuesname - the unique name of the Map<T> Set<T> getSet(String name)
T - the type that the Set holdsname - the unique name of the SetString summary()
Object backup()
boolean recover(Object backup)
backup() method.backup - the backup of the database containing all the structuresString info(String name)
name - the name of the data structurevoid commit()
void clear()
This method does not delete the data-structure themselves, but leaves them empty.
boolean contains(String name)
name - the name of the data structureCopyright © 2017. All rights reserved.