Class TypeArgumentQualifier<T>
java.lang.Object
io.micronaut.inject.qualifiers.FilteringQualifier<T>
io.micronaut.inject.qualifiers.TypeArgumentQualifier<T>
- Type Parameters:
T- The type
- All Implemented Interfaces:
Qualifier<T>
A
Qualifier that qualifies beans by generic type arguments.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Method Summary
Methods inherited from class FilteringQualifier
doesQualify, doesQualifyQualified, filter, filterQualified, getIndexedArgument, reduceMethods inherited from interface Qualifier
contains, doesQualify, qualify
-
Method Details
-
doesQualify
-
getTypeArguments
- Returns:
- The type arguments
-
areTypesCompatible
Are the given types compatible.A candidate that answers no type argument matches any parameterization: it is raw, which is the equivalent of using
Object. The rule holds every bean whose parameterization is not knowable, not only one that has none:- a
BeanDefinitionthat records no argument for this type; - an open generic -
class OpenRepo<T> implements Repo<T>- whose argument is bound at the injection point rather than by the bean; - a
BeanTypethat is not aBeanDefinitionand whose class implements the type raw.
What the rule must no longer hold is a bean whose parameterization simply failed to resolve. That is fixed at the resolution instead, by
GenericTypeUtils.resolveTypeArguments(Class, Class).- Parameters:
typeArguments- The type argumentsclasses- The classes to check for alignments- Returns:
- True if they are
- a
-
equals
-
hashCode
-
toString
-