Class AnyQualifier<T>

  • Type Parameters:
    T - The generic type
    All Implemented Interfaces:
    Qualifier<T>

    @Internal
    public final class AnyQualifier<T>
    extends java.lang.Object
    implements Qualifier<T>
    A qualifier to lookup any type.
    Since:
    3.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(Qualifier<T> qualifier)
      Whether this qualifier contains the given qualifier.
      <BT extends BeanType<T>>
      java.util.Optional<BT>
      qualify​(java.lang.Class<T> beanType, java.util.stream.Stream<BT> candidates)
      Qualify the candidate from the stream of candidates.
      <BT extends BeanType<T>>
      java.util.stream.Stream<BT>
      reduce​(java.lang.Class<T> beanType, java.util.stream.Stream<BT> candidates)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • reduce

        public <BT extends BeanType<T>> java.util.stream.Stream<BT> reduce​(java.lang.Class<T> beanType,
                                                                           java.util.stream.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 it cannot be qualified
      • contains

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

        public <BT extends BeanType<T>> java.util.Optional<BT> qualify​(java.lang.Class<T> beanType,
                                                                       java.util.stream.Stream<BT> candidates)
        Description copied from interface: Qualifier
        Qualify the candidate from the stream of candidates.
        Specified by:
        qualify in interface Qualifier<T>
        Type Parameters:
        BT - The bean type subclass
        Parameters:
        beanType - The bean type
        candidates - The candidates
        Returns:
        The qualified candidate or Optional.empty()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object