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

Method mapKeyFactoryMethod

java/dagger/internal/codegen/MapKeys.java:183–194  ·  view source on GitHub ↗

A static mapKey() method to be added to generated factories when the @MapKey annotation is not publicly accessible.

(ContributionBinding binding, Types types)

Source from the content-addressed store, hash-verified

181 * annotation is not publicly accessible.
182 */
183 static Optional<MethodSpec> mapKeyFactoryMethod(ContributionBinding binding, Types types) {
184 return binding
185 .mapKey()
186 .filter(mapKey -> !isMapKeyPubliclyAccessible(mapKey))
187 .map(
188 mapKey ->
189 methodBuilder("mapKey")
190 .addModifiers(PUBLIC, STATIC)
191 .returns(TypeName.get(mapKeyType(mapKey, types)))
192 .addStatement("return $L", directMapKeyExpression(mapKey))
193 .build());
194 }
195
196 private MapKeys() {}
197}

Callers 2

factoryBuilderMethod · 0.80
writeMethod · 0.80

Calls 7

mapKeyTypeMethod · 0.95
mapKeyMethod · 0.80
mapMethod · 0.65
buildMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected