Enum Class TypeDependency.Kind

java.lang.Object
java.lang.Enum<TypeDependency.Kind>
oracle.dbtools.plugin.api.types.TypeDependency.Kind
All Implemented Interfaces:
Serializable, Comparable<TypeDependency.Kind>, Constable
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 Details

    • 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 Details

    • values

      public static TypeDependency.Kind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TypeDependency.Kind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null