Package nz.org.riskscape.engine
Interface IdentifiedLocator
- All Known Subinterfaces:
Engine
,Engine.Writeable
,Project
public interface IdentifiedLocator
An IdentifiedLocator is a service locator style API that allows an IdentifiedCollection to be looked up by the class
the collection contains, e.g. find me the collection of Bookmark
s.
-
Method Summary
Modifier and TypeMethodDescription<T extends Identified,
U extends IdentifiedCollection<T>>
UgetCollection
(Class<U> collectionClass) <T extends Identified>
IdentifiedCollection<T>getCollectionByClass
(Class<T> identifiedClass) Set<Class<? extends Identified>>
boolean
hasCollectionOf
(Class<? extends Identified> identifiedClass)
-
Method Details
-
getCollectionByClass
- Returns:
- an
IdentifiedCollection
that contains identified objects of the givencollectionClass
type - Throws:
IllegalArgumentException
- if this locator doesn't know about this class
-
getCollection
- Returns:
- an IdentifiedCollection by its concrete type. Useful if the collection has some specific methods on it that you need access to, rather than just the generic ones.
-
hasCollectionOf
- Returns:
- true if getCollectionByClass will return something for the given
collectionClass
-
getCollectionClasses
Set<Class<? extends Identified>> getCollectionClasses()- Returns:
- a set of classes for which this IdentifiedLocator can return a collection
-