oracle.dbtools.plugin.api.types

## Enum TypeDependency.Kind

- java.lang.Object
- - java.lang.Enum<TypeDependency.Kind>
  - - oracle.dbtools.plugin.api.types.TypeDependency.Kind

- All Implemented Interfaces:
    Serializable, Comparable<TypeDependency.Kind>
  Enclosing class:
    TypeDependency

      public static enum TypeDependency.Kind
      extends Enum<TypeDependency.Kind>

  Enumerates how a type will be injected at a particular injetion site
  Author:
    cdivilly

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `MULTIPLE` All available implementations of the type (matching the `TypeQualifier`) are injected
    `OPTIONAL` The dependency is injected if available, otherwise a null value is supplied.
    `PROVIDER` The dependency is injected via a `Provider` instance, resolving of the dependency is deferred until `Provider.get()` is invoked.
    `REQUIRED` The default injection kind, one instance of the required dependency must be available or else instantiation of the type is abandoned and `TypeDependencyNotAvailableException` is raised

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TypeDependency.Kind` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static TypeDependency.Kind[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### MULTIPLE

          public static final TypeDependency.Kind MULTIPLE

      All available implementations of the type (matching the `TypeQualifier`) are injected

           @Inject
           SomeType(final Iterable<SomeOtherType> providers) {
             ...
           }

      - The injection site uses a parameterized `Iterable` declaration to receive all matching instance
      - Matching types which cannot be instantiated because their onward dependencies are unresolvable are silently omitted from the set of matches
      - If no matches are available an empty `Iterable` is injected

    - #### OPTIONAL

          public static final TypeDependency.Kind OPTIONAL

      The dependency is injected if available, otherwise a null value is supplied. Cannot be used for primitive type injections, `MULTIPLE` or `PROVIDER` injections

           @Inject
           SomeType(final @Optional SomeOtherType provider) {
             ...
           }

      - The injection site uses the `Optional` annotation to indicate the dependency is optional

    - #### PROVIDER

          public static final TypeDependency.Kind PROVIDER

      The dependency is injected via a `Provider` instance, resolving of the dependency is deferred until `Provider.get()` is invoked. This can be used for lazy initialization and to break cyclic dependencies

           @Inject
           SomeType(final Provider<SomeOtherType> provider) {
             ...
           }

      - The injection site uses a parameterized `Provider` declaration to receive the matching `Provider`

    - #### REQUIRED

          public static final TypeDependency.Kind REQUIRED

      The default injection kind, one instance of the required dependency must be available or else instantiation of the type is abandoned and `TypeDependencyNotAvailableException` is raised

           @Inject
           SomeType(final SomeOtherType provider) {
             ...
           }

      - The injection site uses the `Optional` annotation to indicate the dependency is optional

  - ### Method Detail

    - #### values

          public static TypeDependency.Kind[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (TypeDependency.Kind c : TypeDependency.Kind.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static TypeDependency.Kind valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

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