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

Method extractKeyType

java/dagger/internal/codegen/RequestKinds.java:132–143  ·  view source on GitHub ↗

Unwraps the framework class(es) of requestKind from type. If requestKind is RequestKind#INSTANCE, this acts as an identity function. @throws TypeNotPresentException if type is an javax.lang.model.type.ErrorType, which may mean that the type will b

(RequestKind requestKind, TypeMirror type)

Source from the content-addressed store, hash-verified

130 * framework class(es).
131 */
132 static TypeMirror extractKeyType(RequestKind requestKind, TypeMirror type) {
133 checkTypePresent(type);
134 switch (requestKind) {
135 case INSTANCE:
136 return type;
137 case PROVIDER_OF_LAZY:
138 return extractKeyType(LAZY, extractKeyType(PROVIDER, type));
139 default:
140 checkArgument(isType(type) && isTypeOf(frameworkClass(requestKind).get(), type));
141 return getOnlyElement(MoreTypes.asDeclared(type).getTypeArguments());
142 }
143 }
144
145 private static final ImmutableMap<RequestKind, Class<?>> FRAMEWORK_CLASSES =
146 ImmutableMap.of(

Callers 4

getRequestKindMethod · 0.95
unwrapOptionalMethod · 0.80
newDependencyRequestMethod · 0.80

Calls 3

frameworkClassMethod · 0.95
getMethod · 0.65
checkTypePresentMethod · 0.45

Tested by

no test coverage detected