132 |
|
* Removes the entry for a key only if currently mapped to a given value. |
133 |
|
* This is equivalent to, for this {@code map}: |
134 |
|
* <pre> {@code |
135 |
< |
* if (map.containsKey(key) && Objects.equals(map.get(key), value)) { |
135 |
> |
* if (map.containsKey(key) |
136 |
> |
* && Objects.equals(map.get(key), value)) { |
137 |
|
* map.remove(key); |
138 |
|
* return true; |
139 |
|
* } else { |
163 |
|
* Replaces the entry for a key only if currently mapped to a given value. |
164 |
|
* This is equivalent to, for this {@code map}: |
165 |
|
* <pre> {@code |
166 |
< |
* if (map.containsKey(key) && Objects.equals(map.get(key), oldValue)) { |
166 |
> |
* if (map.containsKey(key) |
167 |
> |
* && Objects.equals(map.get(key), oldValue)) { |
168 |
|
* map.put(key, newValue); |
169 |
|
* return true; |
170 |
|
* } else { |