Package org.int4.dirk.spi.instantiation
Enum TypeTrait
- java.lang.Object
-
- java.lang.Enum<TypeTrait>
-
- org.int4.dirk.spi.instantiation.TypeTrait
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TypeTrait>
public enum TypeTrait extends java.lang.Enum<TypeTrait>
Traits of anInjectionTargetExtension. These traits can be used to ensure that a set of injectables can always be correctly resolved by rejecting any additions or removals to such a set that would break these rules.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LAZYIndicates that the instance produced is a provider which will only resolve the key upon use.REQUIRES_AT_LEAST_ONEIndicates that at least one matching dependency must be available.REQUIRES_AT_MOST_ONEIndicates that at most one matching dependency can be available.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TypeTraitvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TypeTrait[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LAZY
public static final TypeTrait LAZY
Indicates that the instance produced is a provider which will only resolve the key upon use. This allows for an indirection that will allow avoiding a circular dependency during the construction of instances.Note that this does not allow for the key to be completely unavailable in the underlying store unless not finding any match is allowed. In other words, a lazy dependency allows to break a circular dependency during instantiation, but not during registration.
-
REQUIRES_AT_LEAST_ONE
public static final TypeTrait REQUIRES_AT_LEAST_ONE
Indicates that at least one matching dependency must be available.
-
REQUIRES_AT_MOST_ONE
public static final TypeTrait REQUIRES_AT_MOST_ONE
Indicates that at most one matching dependency can be available.
-
-
Method Detail
-
values
public static TypeTrait[] 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 (TypeTrait c : TypeTrait.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TypeTrait 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
-
-