Returns a new TypeResolver with variable mapping to type.
(Map<TypeVariableKey, ? extends Type> mappings)
| 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; |
nothing calls this directly
no test coverage detected