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

Method forMultibindsMethod

java/dagger/internal/codegen/KeyFactory.java:198–212  ·  view source on GitHub ↗

Returns the key for a Multibinds @Multibinds method. The key's type is either Set or Map >, where F is either Provider or Producer, depending on bindingType.

(
      BindingType bindingType, ExecutableType executableType, ExecutableElement method)

Source from the content-addressed store, hash-verified

196 * {@link Provider} or {@link Producer}, depending on {@code bindingType}.
197 */
198 Key forMultibindsMethod(
199 BindingType bindingType, ExecutableType executableType, ExecutableElement method) {
200 checkArgument(method.getKind().equals(METHOD), "%s must be a method", method);
201 TypeElement factoryType =
202 elements.getTypeElement(bindingType.frameworkClass().getCanonicalName());
203 TypeMirror returnType = executableType.getReturnType();
204 TypeMirror keyType =
205 MapType.isMap(returnType)
206 ? mapOfFrameworkType(
207 MapType.from(returnType).keyType(),
208 factoryType,
209 MapType.from(returnType).valueType())
210 : returnType;
211 return forMethod(method, keyType);
212 }
213
214 private TypeMirror bindingMethodKeyType(
215 TypeMirror returnType,

Callers 2

createMethod · 0.45
visitMethodDefMethod · 0.45

Calls 9

isMapMethod · 0.95
mapOfFrameworkTypeMethod · 0.95
fromMethod · 0.95
forMethodMethod · 0.95
keyTypeMethod · 0.80
equalsMethod · 0.45
getTypeElementMethod · 0.45
frameworkClassMethod · 0.45
valueTypeMethod · 0.45

Tested by

no test coverage detected