oracle.dbtools.plugin.api.types

## Class TypeDependency

- java.lang.Object
- - oracle.dbtools.plugin.api.types.TypeDependency

-     public class TypeDependency
      extends Object

  Encapsulates a single dependency of a type. One type can depend on another in a number of different ways depending on the nature of how the dependent type is injected. These differences are captured in the `TypeDependency.Kind` enumeration. The specific type implementation to be injected can be constrained using `Qualifier` annotations, specifically the `Named` annotation
  Since:
    19.3.0
  Author:
    cdivilly

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TypeDependency.Kind` Enumerates how a type will be injected at a particular injetion site

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `description()` Provides a textual description of a dependency
    `boolean` | `equals(Object obj)`
    `static TypeDependency` | `from(TypeDependency.Kind kind, TypeQualifier<?> service)` Produce a `TypeDependency` instance
    `int` | `hashCode()`
    `boolean` | `isEmpty()` Indicates if this dependency has any qualifiers
    `boolean` | `isRequired()`
    `TypeDependency.Kind` | `kind()` Characterizes how the dependency is injected
    `TypeQualifier<?>` | `qualifier()` The constraints on which implementation of the type to inject
    `String` | `selector()` Produces the source code to replicate the selection of this dependency
    `String` | `toString()`
    `Class<?>` | `type()` The `Class` for the type to be injected

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### description

          public String description()

      Provides a textual description of a dependency
      Returns:
        String containing a description of the dependency

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### isEmpty

          public boolean isEmpty()

      Indicates if this dependency has any qualifiers
      Returns:
        true if the dependency has no qualifiers

    - #### isRequired

          public boolean isRequired()

    - #### kind

          public TypeDependency.Kind kind()

      Characterizes how the dependency is injected
      Returns:
        `TypeDependency.Kind` instance

    - #### qualifier

          public TypeQualifier<?> qualifier()

      The constraints on which implementation of the type to inject
      Returns:
        `TypeQualifier` instance

    - #### selector

          public String selector()

      Produces the source code to replicate the selection of this dependency
      Returns:
        The source code to choose this dependency

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### type

          public Class<?> type()

      The `Class` for the type to be injected
      Returns:
        The type of the dependency

    - #### from

          public static TypeDependency from(TypeDependency.Kind kind,
                                            TypeQualifier<?> service)

      Produce a `TypeDependency` instance
      Parameters:
        `kind` - The `TypeDependency.Kind` of the dependency
        `service` - The service that is depended on
      Returns:
        `TypeDependency` instance

Copyright © 2010, 2022, Oracle and/or its affiliates.