Associates key with value in the built map. Duplicate keys are not allowed, and will cause #build to fail.
(K key, V value)
| 208 | */ |
| 209 | |
| 210 | @CanIgnoreReturnValue |
| 211 | public Builder<K, V> put(K key, V value) { |
| 212 | ensureCapacity(size + 1); |
| 213 | ImmutableMapEntry<K, V> entry = entryOf(key, value); |
| 214 | // don't inline this: we want to fail atomically if key or value is null |
| 215 | entries[size++] = entry; |
| 216 | return this; |
| 217 | } |
| 218 | |
| 219 | /** |
| 220 | * Adds the given {@code entry} to the map, making it immutable if |
no test coverage detected