Enum QualifyingStrategy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<QualifyingStrategy>

    enum QualifyingStrategy
    extends java.lang.Enum<QualifyingStrategy>
    Enumerates the different strategies for qualifying Bindings against requirement Keys.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.lang.annotation.Annotation BLANK_QUALIFIER  
      (package private) static java.lang.annotation.Annotation DEFAULT_QUALIFIER  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private QualifyingStrategy()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) abstract java.lang.annotation.Annotation qualifies​(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding)
      Attempts to qualify the given Binding against the requirement Key.
      (package private) static java.lang.annotation.Annotation qualify​(com.google.inject.Key<?> key)
      Computes a canonical Qualifier annotation for the given binding Key.
      (package private) static QualifyingStrategy selectFor​(com.google.inject.Key<?> key)
      Selects the appropriate qualifying strategy for the given requirement Key.
      static QualifyingStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static QualifyingStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_QUALIFIER

        static final java.lang.annotation.Annotation DEFAULT_QUALIFIER
      • BLANK_QUALIFIER

        static final java.lang.annotation.Annotation BLANK_QUALIFIER
    • Constructor Detail

      • QualifyingStrategy

        private QualifyingStrategy()
    • Method Detail

      • values

        public static QualifyingStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (QualifyingStrategy c : QualifyingStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static QualifyingStrategy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • qualifies

        abstract java.lang.annotation.Annotation qualifies​(com.google.inject.Key<?> requirement,
                                                           com.google.inject.Binding<?> binding)
        Attempts to qualify the given Binding against the requirement Key.
        Parameters:
        requirement - The requirement key
        binding - The binding to qualify
        Returns:
        Qualifier annotation when the binding qualifies; otherwise null
      • selectFor

        static final QualifyingStrategy selectFor​(com.google.inject.Key<?> key)
        Selects the appropriate qualifying strategy for the given requirement Key.
        Parameters:
        key - The requirement key
        Returns:
        Qualifying strategy
      • qualify

        static final java.lang.annotation.Annotation qualify​(com.google.inject.Key<?> key)
        Computes a canonical Qualifier annotation for the given binding Key.
        Parameters:
        key - The key to qualify
        Returns:
        Qualifier for the key