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
()
| 245 | */ |
| 246 | |
| 247 | @CanIgnoreReturnValue |
| 248 | @GwtIncompatible // java.lang.ref.WeakReference |
| 249 | public MapMaker weakValues() { |
| 250 | return setValueStrength(Strength.WEAK); |
| 251 | } |
| 252 | |
| 253 | MapMaker setValueStrength(Strength strength) { |
| 254 | checkState(valueStrength == null, "Value strength was already set to %s", valueStrength); |
no test coverage detected