public abstract class Manager<S>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected KeyTypeInfo |
keyTypes |
Constructor and Description |
---|
Manager() |
Modifier and Type | Method and Description |
---|---|
void |
add(S item)
Store an item to this manager
|
protected abstract KeyTypeInfo |
configure(KeyTypeInfo.Builder builder)
Configure acceptable key types
|
protected abstract void |
delete(S item)
Handle deleting an item from underlying data structures
|
<T,U> boolean |
exists(T key)
Check if a key is set based on configured key types.
|
<T,U> S |
get(T key)
Get a value based on configured key types
|
java.util.Collection<S> |
getAll()
Get everything stored in this manager.
|
protected abstract void |
insert(S item)
Handle inserting an item into underlying data structures
|
protected void |
postConfigure()
Ran after Manager#configure
|
protected void |
preConfigure()
Ran before Manager#configure
|
void |
remove(S item)
Remove an item from this manager
|
protected abstract java.util.Collection<S> |
retrieveAll()
Retrieve values from any data structures in this manager
|
void |
setup()
Populate the manager.
|
protected KeyTypeInfo keyTypes
protected abstract KeyTypeInfo configure(KeyTypeInfo.Builder builder)
builder
- Instance of KeyTypeInfo builderprotected void preConfigure()
protected void postConfigure()
public void setup()
protected abstract void insert(S item)
item
- Item to insertprotected abstract void delete(S item)
item
- Item to deleteprotected abstract java.util.Collection<S> retrieveAll()
public void add(S item)
item
- Itempublic void remove(S item)
item
- Itempublic java.util.Collection<S> getAll()
public <T,U> S get(T key)
T
- Key typeU
- Raw type before mappingkey
- Key valuepublic <T,U> boolean exists(T key)
T
- Key typeU
- Raw type before mappingkey
- Key value