MCPcopy Create free account
hub / github.com/antlr/codebuff / where

Method where

output/java_guava/1.4.18/TypeToken.java:220–224  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

218
219
220 public final <X> TypeToken<T> where(TypeParameter<X> typeParam, TypeToken<X> typeArg) {
221 TypeResolver resolver = new TypeResolver().where(ImmutableMap.of(new TypeResolver.TypeVariableKey(typeParam.typeVariable), typeArg.runtimeType));
222 // If there's any type error, we'd report now rather than later.
223 return new SimpleTypeToken<T>(resolver.resolveType(runtimeType));
224 }
225
226 /**
227 * <p>Returns a new {@code TypeToken} where type variables represented by {@code typeParam} are

Callers 1

Calls 3

ofMethod · 0.95
resolveTypeMethod · 0.95
ofMethod · 0.95

Tested by

no test coverage detected