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

Method where

output/java_guava/1.4.17/TypeResolver.java:271–281  ·  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

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