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

Method where

output/java_guava/1.4.19/TypeResolver.java:273–283  ·  view source on GitHub ↗

Returns a new TypeResolver with variable mapping to type.

(Map<TypeVariableKey, ? extends Type> mappings)

Source from the content-addressed store, hash-verified

271 /** Returns a new {@code TypeResolver} with {@code variable} mapping to {@code type}. */
272
273 final TypeTable where(Map<TypeVariableKey, ? extends Type> mappings) {
274 ImmutableMap.Builder<TypeVariableKey, Type> builder = ImmutableMap.builder();
275 builder.putAll(map);
276 for (Map.Entry<TypeVariableKey, ? extends Type> mapping : mappings.entrySet()) {
277 TypeVariableKey variable = mapping.getKey();
278 Type type = mapping.getValue();
279 checkArgument(!variable.equalsType(type), "Type variable %s bound to itself", variable);
280 builder.put(variable, type);
281 }
282 return new TypeTable(builder.build());
283 }
284
285 final Type resolve(final TypeVariable<?> var) {
286 final TypeTable unguarded = this;

Callers

nothing calls this directly

Calls 9

builderMethod · 0.95
equalsTypeMethod · 0.95
putAllMethod · 0.65
entrySetMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65
putMethod · 0.65
checkArgumentMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected