Class ClosestTypeArgumentQualifier<T>

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

@Internal public final class ClosestTypeArgumentQualifier<T> extends Object implements Qualifier<T>
A Qualifier that qualifies beans by generic type arguments and only returns the candidates that most closely match.
Since:
1.1.1
Author:
James Kleeh
  • Method Details

    • getTypeArguments

      public Class<?>[] getTypeArguments()
      Returns:
      The type arguments
    • 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