Package org.eclipse.sisu.inject
Enum QualifyingStrategy
- All Implemented Interfaces:
Serializable,Comparable<QualifyingStrategy>
Enumerates the different strategies for qualifying
Bindings against requirement Keys.-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Annotation(package private) static final Annotation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract Annotationqualifies(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding) Attempts to qualify the givenBindingagainst the requirementKey.(package private) static final Annotationqualify(com.google.inject.Key<?> key) Computes a canonicalQualifierannotation for the given bindingKey.(package private) static final QualifyingStrategyselectFor(com.google.inject.Key<?> key) Selects the appropriate qualifying strategy for the given requirementKey.static QualifyingStrategyReturns the enum constant of this type with the specified name.static QualifyingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNRESTRICTED
-
NAMED
-
NAMED_WITH_ATTRIBUTES
-
MARKED
-
MARKED_WITH_ATTRIBUTES
-
-
Field Details
-
DEFAULT_QUALIFIER
-
BLANK_QUALIFIER
-
-
Constructor Details
-
QualifyingStrategy
private QualifyingStrategy()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException- if the argument is null
-
qualifies
abstract Annotation qualifies(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding) Attempts to qualify the givenBindingagainst the requirementKey.- Parameters:
requirement- The requirement keybinding- The binding to qualify- Returns:
- Qualifier annotation when the binding qualifies; otherwise
null
-
selectFor
Selects the appropriate qualifying strategy for the given requirementKey.- Parameters:
key- The requirement key- Returns:
- Qualifying strategy
-
qualify
Computes a canonicalQualifierannotation for the given bindingKey.- Parameters:
key- The key to qualify- Returns:
- Qualifier for the key
-