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