public class DefaultRepository extends java.lang.Object implements Repository
Constructor and Description |
---|
DefaultRepository() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String name,
java.lang.Object instance)
Add an object instance to this repository.
|
boolean |
contains(java.lang.String name)
Does this repository contain a object with the specified name.
|
java.lang.Object |
get(java.lang.String name)
Gets the object or recipe with the specified name from this repository.
|
public boolean contains(java.lang.String name)
contains
in interface Repository
name
- the unique name of the object instancepublic java.lang.Object get(java.lang.String name)
get
in interface Repository
name
- the unique name of the object instancepublic void add(java.lang.String name, java.lang.Object instance)
add
in interface Repository
name
- the unique name of the instanceinstance
- the instanceConstructionException
- if another object instance is already registered with the name