Package dagger.model
Class Key
- java.lang.Object
-
- dagger.model.Key
-
public abstract class Key extends java.lang.Object
A type and an optional qualifier that is the lookup key for a binding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Key.Builder
A builder forKey
s.static class
Key.MultibindingContributionIdentifier
An object that identifies a multibinding contribution method and the module class that contributes it to the graph.
-
Constructor Summary
Constructors Constructor Description Key()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Key.Builder
builder(javax.lang.model.type.TypeMirror type)
Returns a builder forKey
s.abstract boolean
equals(java.lang.Object o)
abstract int
hashCode()
abstract java.util.Optional<Key.MultibindingContributionIdentifier>
multibindingContributionIdentifier()
Distinguishes keys for multibinding contributions that share atype()
andqualifier()
.java.util.Optional<javax.lang.model.element.AnnotationMirror>
qualifier()
AQualifier
annotation that provides a unique namespace prefix for the type of this key.abstract Key.Builder
toBuilder()
Returns aKey.Builder
that inherits the properties of this key.java.lang.String
toString()
javax.lang.model.type.TypeMirror
type()
The type represented by this key.
-
-
-
Method Detail
-
qualifier
public final java.util.Optional<javax.lang.model.element.AnnotationMirror> qualifier()
AQualifier
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 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.
-
toBuilder
public abstract Key.Builder toBuilder()
Returns aKey.Builder
that inherits the properties of this key.
-
hashCode
@Memoized public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static Key.Builder builder(javax.lang.model.type.TypeMirror type)
Returns a builder forKey
s.
-
-