Enum Class QualifyingStrategy

java.lang.Object
java.lang.Enum<QualifyingStrategy>
org.eclipse.sisu.inject.QualifyingStrategy
All Implemented Interfaces:
Serializable, Comparable<QualifyingStrategy>, Constable

enum QualifyingStrategy extends Enum<QualifyingStrategy>
Enumerates the different strategies for qualifying Bindings against requirement Keys.
  • Enum Constant Details

  • Field Details

    • DEFAULT_QUALIFIER

      static final Annotation DEFAULT_QUALIFIER
    • BLANK_QUALIFIER

      static final Annotation BLANK_QUALIFIER
  • Constructor Details

    • QualifyingStrategy

      private QualifyingStrategy()
  • Method Details

    • values

      public static QualifyingStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static QualifyingStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • qualifies

      abstract 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 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