Package dagger.spi.model
Class Key
java.lang.Object
dagger.spi.model.Key
A type and an optional qualifier that
is the lookup key for a binding.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder forKeys.static classAn object that identifies a multibinding contribution method and the module class that contributes it to the graph. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Key.Builderbuilder(DaggerType type) Returns a builder forKeys.abstract booleanabstract inthashCode()Distinguishes keys for multibinding contributions that share atype()andqualifier().abstract Optional<DaggerAnnotation>AQualifierannotation that provides a unique namespace prefix for the type of this key.final StringtoString()abstract DaggerTypetype()The type represented by this key.withMultibindingContributionIdentifier(DaggerTypeElement contributingModule, DaggerExecutableElement bindingMethod) Returns a copy of this key with the multibinding contribution identifier replaced with the given multibinding contribution identifier.Returns a copy of this key with the multibinding contribution identifier, if any, removed.withType(DaggerType newType) Returns a copy of this key with the type replaced with the given type.
-
Constructor Details
-
Key
public Key()
-
-
Method Details
-
qualifier
AQualifierannotation that provides a unique namespace prefix for the type of this key. -
type
The type represented by this key. -
multibindingContributionIdentifier
public abstract Optional<Key.MultibindingContributionIdentifier> multibindingContributionIdentifier()Distinguishes keys for multibinding contributions that share atype()andqualifier().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.
-
withType
Returns a copy of this key with the type replaced with the given type. -
withMultibindingContributionIdentifier
public Key withMultibindingContributionIdentifier(DaggerTypeElement contributingModule, DaggerExecutableElement bindingMethod) Returns a copy of this key with the multibinding contribution identifier replaced with the given multibinding contribution identifier. -
withoutMultibindingContributionIdentifier
Returns a copy of this key with the multibinding contribution identifier, if any, removed. -
hashCode
@Memoized public abstract int hashCode() -
equals
-
toString
-
builder
Returns a builder forKeys.
-