@ThreadSafe
@FunctionalInterface
public static interface Cache.Shrinkable<V>
Types should consider implementing Weighted to not invoke
the overhead of using the default weigher multiple times.
This interface may be invoked from any other thread that manipulates the cache causing this value to be shrunk. Implementers must ensure thread safety with respect to any side effects caused.
| Modifier and Type | Method and Description |
|---|---|
V |
shrink()
Returns a new object that is smaller than the object being evicted.
|
@Nullable V shrink()
It is recommended to return an object that is at most half as large as the one being
evicted. If null is returned then the object will be evicted.