(V value)
| 348 | } |
| 349 | |
| 350 | @Override |
| 351 | public V setValue(V value) { |
| 352 | // Preconditions keep the map and inverse consistent. |
| 353 | checkState(contains(this), "entry no longer in map"); |
| 354 | // similar to putInBothMaps, but set via entry |
| 355 | if (Objects.equal(value, getValue())) { |
| 356 | return value; |
| 357 | } |
| 358 | checkArgument(!containsValue(value), "value already present: %s", value); |
| 359 | V oldValue = finalEntry.setValue(value); |
| 360 | checkState(Objects.equal(value, get(getKey())), "entry no longer in map"); |
| 361 | updateInverseMap(getKey(), true, oldValue, value); |
| 362 | return oldValue; |
| 363 | } |
| 364 | }; |
| 365 | } |
| 366 |
nothing calls this directly
no test coverage detected