MCPcopy Index your code
hub / github.com/google/dagger / unwrapValue

Method unwrapValue

java/dagger/internal/codegen/MapKeys.java:83–90  ·  view source on GitHub ↗

Returns the annotation value if mapKey's type is annotated with MapKey @MapKey(unwrapValue = true). @throws IllegalArgumentException if mapKey's type is not annotated with MapKey @MapKey at all.

(AnnotationMirror mapKey)

Source from the content-addressed store, hash-verified

81 * {@link MapKey @MapKey} at all.
82 */
83 static Optional<? extends AnnotationValue> unwrapValue(AnnotationMirror mapKey) {
84 MapKey mapKeyAnnotation = mapKey.getAnnotationType().asElement().getAnnotation(MapKey.class);
85 checkArgument(
86 mapKeyAnnotation != null, "%s is not annotated with @MapKey", mapKey.getAnnotationType());
87 return mapKeyAnnotation.unwrapValue()
88 ? Optional.of(getOnlyElement(getAnnotationValuesWithDefaults(mapKey).values()))
89 : Optional.empty();
90 }
91
92 static TypeMirror mapKeyType(AnnotationMirror mapKeyAnnotation, Types types) {
93 return unwrapValue(mapKeyAnnotation).isPresent()

Callers 6

mapKeyTypeMethod · 0.95
processMethod · 0.80
validateMethod · 0.80

Calls 5

asElementMethod · 0.80
getAnnotationTypeMethod · 0.80
valuesMethod · 0.65
ofMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected