|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jdroid.java.repository.InMemoryRepository<T>
T - public class InMemoryRepository<T extends Identifiable>
| Constructor Summary | |
|---|---|
InMemoryRepository()
|
|
| Method Summary | |
|---|---|
void |
add(T item)
Adds an Identifiable to the repository. |
void |
addAll(Collection<T> items)
Adds a collection of Identifiables to the repository. |
List<T> |
findByField(String fieldName,
Collection<? extends Object> values)
|
T |
get(Long id)
Retrieves an Identifiable from the repository according to an id or null in case no Identifiable
with the given id is not found |
List<T> |
getAll()
Obtains a list containing all the Identifiables in the repository |
List<T> |
getAll(List<Long> ids)
|
Long |
getSize()
|
T |
getUniqueInstance()
|
Boolean |
isEmpty()
|
void |
remove(Long 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(Collection<T> items)
|
void |
replaceAll(Collection<T> items)
Replaces all the Identifiables in the repository by new ones. |
void |
update(T item)
Update an Identifiable on the repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryRepository()
| Method Detail |
|---|
public void add(T item)
RepositoryIdentifiable to the repository.
add in interface Repository<T extends Identifiable>item - The Identifiable to add.Repository.add(com.jdroid.java.domain.Identifiable)public void addAll(Collection<T> items)
RepositoryIdentifiables to the repository.
addAll in interface Repository<T extends Identifiable>items - The Identifiables to add.Repository.addAll(java.util.Collection)public void update(T item)
RepositoryIdentifiable on the repository.
update in interface Repository<T extends Identifiable>item - The Identifiable to update.Repository.update(com.jdroid.java.domain.Identifiable)public void remove(T item)
RepositoryIdentifiable from the repository.
remove in interface Repository<T extends Identifiable>item - The Identifiable to removeRepository.remove(com.jdroid.java.domain.Identifiable)public void removeAll(Collection<T> items)
removeAll in interface Repository<T extends Identifiable>Repository.removeAll(java.util.Collection)public void replaceAll(Collection<T> items)
RepositoryIdentifiables in the repository by new ones.
replaceAll in interface Repository<T extends Identifiable>items - The new Identifiables to replace the old ones.Repository.replaceAll(java.util.Collection)public List<T> getAll()
RepositoryIdentifiables in the repository
getAll in interface Repository<T extends Identifiable>IdentifiablesRepository.getAll()public T get(Long id)
RepositoryIdentifiable from the repository according to an id or null in case no Identifiable
with the given id is not found
get in interface Repository<T extends Identifiable>id - the id for the Identifiable to retrieve
Identifiable retrieved.Repository.get(java.lang.Long)public void removeAll()
RepositoryIdentifiables that the repository has.
removeAll in interface Repository<T extends Identifiable>Repository.removeAll()public void remove(Long id)
RepositoryIdentifiable with the id
remove in interface Repository<T extends Identifiable>id - The Identifiable id to be removedRepository.remove(java.lang.Long)public Boolean isEmpty()
isEmpty in interface Repository<T extends Identifiable>Repository.isEmpty()public Long getSize()
getSize in interface Repository<T extends Identifiable>Repository.getSize()
public List<T> findByField(String fieldName,
Collection<? extends Object> values)
findByField in interface Repository<T extends Identifiable>Repository.findByField(java.lang.String, java.util.Collection)public List<T> getAll(List<Long> ids)
getAll in interface Repository<T extends Identifiable>Repository.getAll(java.util.List)public T getUniqueInstance()
getUniqueInstance in interface Repository<T extends Identifiable>Repository.getUniqueInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||