|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.cinnamon.reflect.util.ClassMappedRepository<T>
public class ClassMappedRepository<T>
Respository for objects that are associated with a certain Java class. This will also take into account subclasses and subinterfaces when retrieving those instances from the repository.
| Constructor Summary | |
|---|---|
ClassMappedRepository()
|
|
| Method Summary | |
|---|---|
void |
add(Class<?> type,
T item)
Adds the given item and associates it with the given class and all its subclasses or subinterfaces. |
T |
get(Class<?> type)
Returns the item associated with the given type. |
Set<T> |
getAll()
Returns a Set of all items that were added to this repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassMappedRepository()
| Method Detail |
|---|
public void add(Class<?> type,
T item)
type - the type the item should be associated withitem - the item to be added to the repositorypublic T get(Class<?> type)
type - the type for which the associated item should be retrieved
public Set<T> getAll()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||