Class FilteringQualifier<T>
java.lang.Object
io.micronaut.inject.qualifiers.FilteringQualifier<T>
- Type Parameters:
T- The qualifier type
- All Implemented Interfaces:
Qualifier<T>
- Direct Known Subclasses:
AnyQualifier, EachBeanQualifier, InterceptorBindingQualifier, PrimaryQualifier, TypeAnnotationQualifier, TypeArgumentQualifier
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoesQualify(Class<T> beanType, Collection<? extends BeanType<T>> candidates) Check if at least one candidate qualifies.booleandoesQualifyQualified(Class<T> beanType, Collection<? extends QualifiedBeanType<T>> candidates) Check if at least one candidate qualifies.<BT extends BeanType<T>>
Collection<BT> filter(Class<T> beanType, Collection<BT> candidates) Filter the candidates.<BT extends QualifiedBeanType<T>>
Collection<BT> filterQualified(Class<T> beanType, Collection<BT> candidates) Filter the qualified candidates.The type the beans this qualifier selects are indexed by, when the compile-time index is an exhaustive answer for it.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Qualifier
contains, doesQualify, doesQualify, qualify
-
Constructor Details
-
FilteringQualifier
public FilteringQualifier()
-
-
Method Details
-
getIndexedArgument
The type the beans this qualifier selects are indexed by, when the compile-time index is an exhaustive answer for it. A qualifier that reports one can be answered by looking that type up in the index instead of filtering every bean definition reference.An
Argumentrather than aClassso that the qualifier holds the one the index is keyed by, instead of a new one being built on every lookup.- Returns:
- The indexed type, or
nullwhen the qualifier has to be answered by filtering - Since:
- 5.2.0
-
reduce
-
doesQualify
Description copied from interface:QualifierCheck if at least one candidate qualifies.- Specified by:
doesQualifyin interfaceQualifier<T>- Parameters:
beanType- The bean typecandidates- The candidates- Returns:
- true if qualifies
-
doesQualifyQualified
public boolean doesQualifyQualified(Class<T> beanType, Collection<? extends QualifiedBeanType<T>> candidates) Description copied from interface:QualifierCheck if at least one candidate qualifies.- Specified by:
doesQualifyQualifiedin interfaceQualifier<T>- Parameters:
beanType- The bean typecandidates- The candidates- Returns:
- true if qualifies
-
filter
Description copied from interface:QualifierFilter the candidates. -
filterQualified
public <BT extends QualifiedBeanType<T>> Collection<BT> filterQualified(Class<T> beanType, Collection<BT> candidates) Description copied from interface:QualifierFilter the qualified candidates.- Specified by:
filterQualifiedin interfaceQualifier<T>- Type Parameters:
BT- The bean type subclass- Parameters:
beanType- The bean typecandidates- The candidates- Returns:
- The filtered candidates
-