Specifies that each key (not value) stored in the cache should be wrapped in a WeakReference (by default, strong references are used). Warning: when this method is used, the resulting cache will use identity (==) comparison to determine equality of keys. Entries with k
()
| 534 | */ |
| 535 | |
| 536 | @GwtIncompatible // java.lang.ref.WeakReference |
| 537 | public CacheBuilder<K, V> weakKeys() { |
| 538 | return setKeyStrength(Strength.WEAK); |
| 539 | } |
| 540 | |
| 541 | CacheBuilder<K, V> setKeyStrength(Strength strength) { |
| 542 | checkState(keyStrength == null, "Key strength was already set to %s", keyStrength); |
no test coverage detected