Package oracle.dbtools.plugin.api.di
Class Instances
- java.lang.Object
-
- oracle.dbtools.plugin.api.di.Instances
-
- All Implemented Interfaces:
InstanceLocator
public class Instances extends java.lang.Object implements InstanceLocator
Locates concrete instances of types- Since:
- 19.3.0
- Author:
- cdivilly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Instances.Builder
BuildInstances
instancesstatic class
Instances.QualifiedInstance<T>
Represents an individual instance of a qualified service
-
Field Summary
-
Fields inherited from interface oracle.dbtools.plugin.api.di.InstanceLocator
INSTANCE_LOCATOR_ATTRIBUTE, INSTANTIATOR_TYPE_SUFFIX
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Instances.Builder
builder()
Produce a newInstances.Builder
instancejava.util.Set<java.util.Map.Entry<TypeQualifier<?>,InstanceProvider<?>>>
entries()
Enumerate each of the instances in this setboolean
isEmpty()
Indicate if this set of instances is emptyInstances.Builder
modify()
Produce aInstances.Builder
instance initialized with the state of this instance<T> java.util.List<Instances.QualifiedInstance<T>>
qualifiedInstances(java.lang.Class<T> type)
ProvideInstances.QualifiedInstance
for each instance of the specified type<T> InstanceProvider<T>
select(TypeQualifier<T> service)
Select all services matching the specifiedTypeQualifier
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface oracle.dbtools.plugin.api.di.InstanceLocator
select, select
-
-
-
-
Method Detail
-
entries
public java.util.Set<java.util.Map.Entry<TypeQualifier<?>,InstanceProvider<?>>> entries()
Enumerate each of the instances in this set- Returns:
Set
ofMap.Entry
elements, whose key is aTypeQualifier
and it's value is anInstanceProvider
-
isEmpty
public boolean isEmpty()
Indicate if this set of instances is empty- Returns:
- true if there are no instances in this set, false otherwise
-
modify
public Instances.Builder modify()
Produce aInstances.Builder
instance initialized with the state of this instance- Returns:
Instances.Builder
instance
-
qualifiedInstances
public <T> java.util.List<Instances.QualifiedInstance<T>> qualifiedInstances(java.lang.Class<T> type)
ProvideInstances.QualifiedInstance
for each instance of the specified type- Type Parameters:
T
- The type of the instances to retrieve- Parameters:
type
- the type of the instances to retrieve- Returns:
List
ofInstances.QualifiedInstance
matches
-
select
public <T> InstanceProvider<T> select(TypeQualifier<T> service)
Description copied from interface:InstanceLocator
Select all services matching the specifiedTypeQualifier
- Specified by:
select
in interfaceInstanceLocator
- Type Parameters:
T
- The type of the service to locate- Parameters:
service
- The qualifier that constrains which implementation to match- Returns:
InstanceProvider
for the specified type and qualifier. This value is never null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static Instances.Builder builder()
Produce a newInstances.Builder
instance- Returns:
Instances.Builder
instance
-
-