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