Class AnyQualifier<T>

java.lang.Object
io.micronaut.inject.qualifiers.FilteringQualifier<T>
io.micronaut.inject.qualifiers.AnyQualifier<T>
Type Parameters:
T - The generic type
All Implemented Interfaces:
Qualifier<T>

@Internal public final class AnyQualifier<T> extends FilteringQualifier<T>
A qualifier to look up any type.
Since:
3.0.0
  • Field Details

  • Method Details

    • doesQualify

      public boolean doesQualify(Class<T> beanType, BeanType<T> candidate)
      Description copied from interface: Qualifier
      Check if the candidate qualifies.
      Parameters:
      beanType - The bean type
      candidate - The candidate
      Returns:
      true if matches
    • reduce

      public <BT extends BeanType<T>> Stream<BT> reduce(Class<T> beanType, Stream<BT> candidates)
      Specified by:
      reduce in interface Qualifier<T>
      Overrides:
      reduce in class FilteringQualifier<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
    • contains

      public boolean contains(Qualifier<T> qualifier)
      Description copied from interface: Qualifier
      Whether this qualifier contains the given qualifier.
      Parameters:
      qualifier - The qualifier
      Returns:
      True it does
    • qualify

      public <BT extends BeanType<T>> Optional<BT> qualify(Class<T> beanType, Stream<BT> candidates)
      Description copied from interface: Qualifier
      Qualify the candidate from the stream of candidates.
      Type Parameters:
      BT - The bean type subclass
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      The qualified candidate or Optional.empty()
    • 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>
      Overrides:
      doesQualify in class FilteringQualifier<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>
      Overrides:
      filter in class FilteringQualifier<T>
      Type Parameters:
      BT - The bean type subclass
      Parameters:
      beanType - The bean type
      candidates - The candidates
      Returns:
      The filtered candidates
    • toString

      public String toString()
      Overrides:
      toString in class Object