Returns a new TypeToken where type variables represented by typeParam are substituted by typeArg. For example, it can be used to construct Map for any K and V type: {@code static TypeToken > mapOf( TypeToken
(TypeParameter<X> typeParam, TypeToken<X> typeArg)
| 217 | |
| 218 | |
| 219 | public final <X> TypeToken<T> where(TypeParameter<X> typeParam, TypeToken<X> typeArg) { |
| 220 | TypeResolver resolver = new TypeResolver().where(ImmutableMap.of(new TypeResolver.TypeVariableKey(typeParam.typeVariable), typeArg.runtimeType)); |
| 221 | // If there's any type error, we'd report now rather than later. |
| 222 | return new SimpleTypeToken<T>(resolver.resolveType(runtimeType)); |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * <p>Returns a new {@code TypeToken} where type variables represented by {@code typeParam} are |
no test coverage detected