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` | Build `Instances` instances
    `static 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 new `Instances.Builder` instance
    `java.util.Set<java.util.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> java.util.List<Instances.QualifiedInstance<T>>` | `qualifiedInstances​(java.lang.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`
    `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` of `Map.Entry` elements, whose key is a `TypeQualifier` and it's value is an `InstanceProvider`

    - #### 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 a `Instances.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)

      Provide `Instances.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` of `Instances.QualifiedInstance` matches

    - #### select

          public <T> InstanceProvider<T> select​(TypeQualifier<T> service)

      Description copied from interface: `InstanceLocator`
      Select all services matching the specified `TypeQualifier`
      Specified by:
        `select` in interface `InstanceLocator`
      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 class `java.lang.Object`

    - #### builder

          public static Instances.Builder builder()

      Produce a new `Instances.Builder` instance
      Returns:
        `Instances.Builder` instance