/** * Associates all of the given map's keys and values in the built map. * Duplicate keys are not allowed, and will cause {@link #build} to fail. * * @throws NullPointerException if any key or value in {@code map} is null */ @CanIgnoreReturnValue public Builder<K, V> putAll(Map<? extends K, ? extends V> map) { return putAll(map.entrySet()); }
/** Returns a new {@code TypeResolver} with {@code variable} mapping to {@code type}. */ final TypeTable where(Map<TypeVariableKey, ? extends Type> mappings) { ImmutableMap.Builder<TypeVariableKey, Type> builder = ImmutableMap.builder(); builder.putAll(map); for (Map.Entry<TypeVariableKey, ? extends Type> mapping : mappings.entrySet()) { TypeVariableKey variable = mapping.getKey(); Type type = mapping.getValue(); checkArgument(!variable.equalsType(type), "Type variable %s bound to itself", variable); builder.put(variable, type); } return new TypeTable(builder.build()); }
/** * Adds all the given entries to the built map. Duplicate keys, according * to the comparator (which might be the keys' natural order), are not * allowed, and will cause {@link #build} to fail. * * @throws NullPointerException if any key, value, or entry is null * @since 19.0 */ @CanIgnoreReturnValue @Beta @Override public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) { super.putAll(entries); return this; }
/** * Adds all of the given entries to the built bimap. Duplicate keys or * values are not allowed, and will cause {@link #build} to fail. * * @throws NullPointerException if any key, value, or entry is null * @since 19.0 */ @CanIgnoreReturnValue @Beta @Override public Builder<K, V> putAll(Iterable<? extends Entry<? extends K, ? extends V>> entries) { super.putAll(entries); return this; }
/** * Associates all of the given map's keys and values in the built map. * Duplicate keys, according to the comparator (which might be the keys' * natural order), are not allowed, and will cause {@link #build} to fail. * * @throws NullPointerException if any key or value in {@code map} is null */ @CanIgnoreReturnValue @Override public Builder<K, V> putAll(Map<? extends K, ? extends V> map) { super.putAll(map); return this; }
/** * Associates all of the given map's keys and values in the built bimap. * Duplicate keys or values are not allowed, and will cause {@link #build} * to fail. * * @throws NullPointerException if any key or value in {@code map} is null */ @CanIgnoreReturnValue @Override public Builder<K, V> putAll(Map<? extends K, ? extends V> map) { super.putAll(map); return this; }