public class Instances extends Object implements InstanceLocator
Modifier and Type | Class and Description |
---|---|
static class |
Instances.Builder
Build
Instances instances |
static class |
Instances.QualifiedInstance<T>
Represents an individual instance of a qualified service
|
INSTANCE_LOCATOR_ATTRIBUTE, INSTANTIATOR_TYPE_SUFFIX
Modifier and Type | Method and Description |
---|---|
static Instances.Builder |
builder()
Produce a new
Instances.Builder instance |
Set<Map.Entry<TypeQualifier<?>,InstanceProvider<?>>> |
entries()
Enumerate each of the instances in this set
|
boolean |
isEmpty()
Indicate if this set of instances is empty
|
Instances.Builder |
modify()
Produce a
Instances.Builder instance initialized with the state of this
instance |
<T> List<Instances.QualifiedInstance<T>> |
qualifiedInstances(Class<T> type)
Provide
Instances.QualifiedInstance for each instance of the specified type |
<T> InstanceProvider<T> |
select(TypeQualifier<T> service)
Select all services matching the specified
TypeQualifier |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
select, select
public Set<Map.Entry<TypeQualifier<?>,InstanceProvider<?>>> entries()
Set
of Map.Entry
elements, whose key is a TypeQualifier
and it's value is an
InstanceProvider
public boolean isEmpty()
public Instances.Builder modify()
Instances.Builder
instance initialized with the state of this
instanceInstances.Builder
instancepublic <T> List<Instances.QualifiedInstance<T>> qualifiedInstances(Class<T> type)
Instances.QualifiedInstance
for each instance of the specified typeT
- The type of the instances to retrievetype
- the type of the instances to retrieveList
of Instances.QualifiedInstance
matchespublic <T> InstanceProvider<T> select(TypeQualifier<T> service)
InstanceLocator
TypeQualifier
select
in interface InstanceLocator
T
- The type of the service to locateservice
- The qualifier that constrains which implementation to matchInstanceProvider
for the specified type and qualifier. This
value is never null.public static Instances.Builder builder()
Instances.Builder
instanceInstances.Builder
instance