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

@Internal public abstract class FilteringQualifier<T> extends Object implements Qualifier<T>
A variation of Qualifier that is a simple filter.
Since:
4.2.0
Author:
Denis Stepanov
  • Constructor Details

    • FilteringQualifier

      public FilteringQualifier()
  • Method Details

    • reduce

      public <BT extends BeanType<T>> Stream<BT> reduce(Class<T> beanType, Stream<BT> candidates)
      Specified by:
      reduce in interface Qualifier<T>
      Type Parameters:
      BT - The bean type subclass
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      The qualified candidate or null it cannot be qualified
    • doesQualify

      public boolean doesQualify(Class<T> beanType, Collection<? extends BeanType<T>> candidates)
      Description copied from interface: Qualifier
      Check if at least one candidate qualifies.
      Specified by:
      doesQualify in interface Qualifier<T>
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      true if qualifies
    • filter

      public <BT extends BeanType<T>> Collection<BT> filter(Class<T> beanType, Collection<BT> candidates)
      Description copied from interface: Qualifier
      Filter the candidates.
      Specified by:
      filter in interface Qualifier<T>
      Type Parameters:
      BT - The bean type subclass
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      The filtered candidates