Package dagger.model

Class Key

java.lang.Object
dagger.model.Key

public abstract class Key extends Object
A type and an optional qualifier that is the lookup key for a binding.
  • Constructor Details

    • Key

      public Key()
  • Method Details

    • qualifier

      public final Optional<AnnotationMirror> qualifier()
      A Qualifier annotation that provides a unique namespace prefix for the type of this key.
    • type

      public final TypeMirror type()
      The type represented by this key.
    • multibindingContributionIdentifier

      public abstract Optional<Key.MultibindingContributionIdentifier> multibindingContributionIdentifier()
      Distinguishes keys for multibinding contributions that share a type() and qualifier().

      Each multibound map and set has a synthetic multibinding that depends on the specific contributions to that map or set using keys that identify those multibinding contributions.

      Absent except for multibinding contributions.

    • toBuilder

      public abstract Key.Builder toBuilder()
      Returns a Key.Builder that inherits the properties of this key.
    • hashCode

      @Memoized public abstract int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public abstract boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • builder

      public static Key.Builder builder(TypeMirror type)
      Returns a builder for Keys.