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 classInstances.BuilderBuildInstancesinstancesstatic classInstances.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.Builderbuilder()Produce a newInstances.Builderinstancejava.util.Set<java.util.Map.Entry<TypeQualifier<?>,InstanceProvider<?>>>entries()Enumerate each of the instances in this setbooleanisEmpty()Indicate if this set of instances is emptyInstances.Buildermodify()Produce aInstances.Builderinstance initialized with the state of this instance<T> java.util.List<Instances.QualifiedInstance<T>>qualifiedInstances(java.lang.Class<T> type)ProvideInstances.QualifiedInstancefor each instance of the specified type<T> InstanceProvider<T>select(TypeQualifier<T> service)Select all services matching the specifiedTypeQualifierjava.lang.StringtoString()-
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:
SetofMap.Entryelements, whose key is aTypeQualifierand 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.Builderinstance initialized with the state of this instance- Returns:
Instances.Builderinstance
-
qualifiedInstances
public <T> java.util.List<Instances.QualifiedInstance<T>> qualifiedInstances(java.lang.Class<T> type)
ProvideInstances.QualifiedInstancefor 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:
ListofInstances.QualifiedInstancematches
-
select
public <T> InstanceProvider<T> select(TypeQualifier<T> service)
Description copied from interface:InstanceLocatorSelect all services matching the specifiedTypeQualifier- Specified by:
selectin interfaceInstanceLocator- Type Parameters:
T- The type of the service to locate- Parameters:
service- The qualifier that constrains which implementation to match- Returns:
InstanceProviderfor the specified type and qualifier. This value is never null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static Instances.Builder builder()
Produce a newInstances.Builderinstance- Returns:
Instances.Builderinstance
-
-