public class InMemoryCRUDAccessor<T extends AbstractIdentifiableObject> extends Object implements CRUDAccessor<T>
| Modifier and Type | Field and Description |
|---|---|
protected Map<org.bson.types.ObjectId,T> |
map |
| Constructor and Description |
|---|
InMemoryCRUDAccessor() |
| Modifier and Type | Method and Description |
|---|---|
T |
findByAttributes(Map<String,String> attributes)
Find an object by attributes.
|
T |
get(org.bson.types.ObjectId id)
Get an object by id
|
Iterator<T> |
getAll() |
void |
remove(org.bson.types.ObjectId id) |
void |
save(List<? extends T> entities)
Save a list of entities.
|
T |
save(T entity)
Save an entity.
|
protected Map<org.bson.types.ObjectId,T extends AbstractIdentifiableObject> map
public T get(org.bson.types.ObjectId id)
Accessorget in interface Accessor<T extends AbstractIdentifiableObject>id - the UID of the objectpublic T findByAttributes(Map<String,String> attributes)
AccessorfindByAttributes in interface Accessor<T extends AbstractIdentifiableObject>attributes - the map of mandatory attributes of the object to be foundpublic Iterator<T> getAll()
getAll in interface Accessor<T extends AbstractIdentifiableObject>public void remove(org.bson.types.ObjectId id)
remove in interface CRUDAccessor<T extends AbstractIdentifiableObject>public T save(T entity)
CRUDAccessorsave in interface CRUDAccessor<T extends AbstractIdentifiableObject>entity - the entity instance to be savedpublic void save(List<? extends T> entities)
CRUDAccessorsave in interface CRUDAccessor<T extends AbstractIdentifiableObject>entities - the list of entities to be savedCopyright © 2019. All rights reserved.