Package org.eclipse.sisu.inject
Enum Class QualifyingStrategy
- All Implemented Interfaces:
Serializable
,Comparable<QualifyingStrategy>
,Constable
Enumerates the different strategies for qualifying
Binding
s against requirement Key
s.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
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 Annotation
qualifies
(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding) Attempts to qualify the givenBinding
against the requirementKey
.(package private) static final Annotation
qualify
(com.google.inject.Key<?> key) Computes a canonicalQualifier
annotation for the given bindingKey
.(package private) static final QualifyingStrategy
selectFor
(com.google.inject.Key<?> key) Selects the appropriate qualifying strategy for the given requirementKey
.static QualifyingStrategy
Returns the enum constant of this class with the specified name.static QualifyingStrategy[]
values()
Returns an array containing the constants of this enum class, 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 class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-
qualifies
abstract Annotation qualifies(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding) Attempts to qualify the givenBinding
against 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 canonicalQualifier
annotation for the given bindingKey
.- Parameters:
key
- The key to qualify- Returns:
- Qualifier for the key
-