Specifies that each value (not key) stored in the map should be wrapped in a WeakReference (by default, strong references are used). Weak values will be garbage collected once they are weakly reachable. This makes them a poor candidate for caching. Warning: when this method is
()
| 247 | */ |
| 248 | |
| 249 | @CanIgnoreReturnValue |
| 250 | @GwtIncompatible // java.lang.ref.WeakReference |
| 251 | public MapMaker weakValues() { |
| 252 | return setValueStrength(Strength.WEAK); |
| 253 | } |
| 254 | |
| 255 | MapMaker setValueStrength(Strength strength) { |
| 256 | checkState(valueStrength == null, "Value strength was already set to %s", valueStrength); |
no test coverage detected