Package dagger.model

Class Key

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

      • Key

        public Key()
    • Method Detail

      • qualifier

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

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

        public abstract java.util.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

        public abstract int hashCode()
        hashCode in class java.lang.Object
      • equals

        public abstract boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • toString

        public final java.lang.String toString()
        toString in class java.lang.Object
      • builder

        public static Key.Builder builder​(javax.lang.model.type.TypeMirror type)
        Returns a builder for Keys.