Package 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:
java.io.Serializable,java.lang.Comparable<TypeDependency.Kind>
- Enclosing class:
- TypeDependency
public static enum TypeDependency.Kind extends java.lang.Enum<TypeDependency.Kind>
Enumerates how a type will be injected at a particular injetion site- Author:
- cdivilly
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MULTIPLEAll available implementations of the type (matching theTypeQualifier) are injectedOPTIONALThe dependency is injected if available, otherwise a null value is supplied.PROVIDERThe dependency is injected via aProviderinstance, resolving of the dependency is deferred untilProvider.get()is invoked.REQUIREDThe default injection kind, one instance of the required dependency must be available or else instantiation of the type is abandoned andTypeDependencyNotAvailableExceptionis raised
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TypeDependency.KindvalueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
MULTIPLE
public static final TypeDependency.Kind MULTIPLE
All available implementations of the type (matching theTypeQualifier) are injected@Inject SomeType(final Iterable<SomeOtherType> providers) { ... }- The injection site uses a parameterized
Iterabledeclaration 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
Iterableis injected
- The injection site uses a parameterized
-
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,MULTIPLEorPROVIDERinjections@Inject SomeType(final @Optional SomeOtherType provider) { ... }- The injection site uses the
Optionalannotation to indicate the dependency is optional
- The injection site uses the
-
PROVIDER
public static final TypeDependency.Kind PROVIDER
The dependency is injected via aProviderinstance, resolving of the dependency is deferred untilProvider.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
Providerdeclaration to receive the matchingProvider
- The injection site uses a parameterized
-
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 andTypeDependencyNotAvailableExceptionis raised@Inject SomeType(final SomeOtherType provider) { ... }- The injection site uses the
Optionalannotation to indicate the dependency is optional
- The injection site uses the
-
-
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(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-