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

Method getMapKeyExpression

java/dagger/internal/codegen/MapKeys.java:147–153  ·  view source on GitHub ↗

Returns a code block for binding's ContributionBinding#mapKey() map key. If for whatever reason the map key is not accessible from within requestingClass (i.e. it has a package-private enum from a different package), this will return an invocation of a proxy-method gi

(ContributionBinding binding, ClassName requestingClass)

Source from the content-addressed store, hash-verified

145 * map} contribution.
146 */
147 static CodeBlock getMapKeyExpression(ContributionBinding binding, ClassName requestingClass) {
148 AnnotationMirror mapKeyAnnotation = binding.mapKey().get();
149 return MapKeyAccessibility.isMapKeyAccessibleFrom(
150 mapKeyAnnotation, requestingClass.packageName())
151 ? directMapKeyExpression(mapKeyAnnotation)
152 : CodeBlock.of("$T.mapKey()", generatedClassNameForBinding(binding));
153 }
154
155 /**
156 * Returns a code block for the map key annotation {@code mapKey}.

Callers 2

keyAndValueExpressionMethod · 0.80
creationExpressionMethod · 0.80

Calls 7

mapKeyMethod · 0.80
packageNameMethod · 0.80
getMethod · 0.65
ofMethod · 0.45

Tested by

no test coverage detected