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)
| 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( |
no test coverage detected