T - The type of Identifiablepublic interface Repository<T extends Identifiable>
| Modifier and Type | Method and Description |
|---|---|
void |
add(T item)
Adds an
Identifiable to the repository. |
void |
addAll(java.util.Collection<T> items)
Adds a collection of
Identifiables to the repository. |
java.util.List<T> |
findByField(java.lang.String fieldName,
java.lang.Object... values) |
T |
get(java.lang.String id)
Retrieves an
Identifiable from the repository according to an id or null in case no Identifiable
with the given id is not found |
java.util.List<T> |
getAll()
Obtains a list containing all the
Identifiables in the repository |
java.util.List<T> |
getAll(java.util.List<java.lang.String> ids) |
java.lang.Long |
getSize() |
T |
getUniqueInstance() |
java.lang.Boolean |
isEmpty() |
void |
remove(java.lang.String id)
Removes the
Identifiable with the id |
void |
remove(T item)
Removes an
Identifiable from the repository. |
void |
removeAll()
Removes all the
Identifiables that the repository has. |
void |
removeAll(java.util.Collection<T> items) |
void |
replaceAll(java.util.Collection<T> items)
Replaces all the
Identifiables in the repository by new ones. |
void |
update(T item)
Update an
Identifiable on the repository. |
T get(java.lang.String id)
Identifiable from the repository according to an id or null in case no Identifiable
with the given id is not foundid - the id for the Identifiable to retrieveIdentifiable retrieved.void add(T item)
Identifiable to the repository.item - The Identifiable to add.void addAll(java.util.Collection<T> items)
Identifiables to the repository.items - The Identifiables to add.void update(T item)
Identifiable on the repository.item - The Identifiable to update.void remove(T item)
Identifiable from the repository.item - The Identifiable to removevoid removeAll()
Identifiables that the repository has.void removeAll(java.util.Collection<T> items)
java.util.List<T> findByField(java.lang.String fieldName, java.lang.Object... values)
fieldName - values - java.util.List<T> getAll()
Identifiables in the repositoryIdentifiablesjava.util.List<T> getAll(java.util.List<java.lang.String> ids)
ids - void remove(java.lang.String id)
Identifiable with the idid - The Identifiable id to be removedjava.lang.Boolean isEmpty()
java.lang.Long getSize()
void replaceAll(java.util.Collection<T> items)
Identifiables in the repository by new ones.items - The new Identifiables to replace the old ones.T getUniqueInstance()