Returns Some(
value associated with key
in this cache)
, or None if there is no cached value for key
.
Returns Some(
value associated with key
in this cache)
, or None if there is no cached value for key
.
Returns the value associated with key
in this cache, obtaining that value from
defaultValue
if necessary.
Returns the value associated with key
in this cache, obtaining that value from
defaultValue
if necessary. No observable state associated with this cache is modified
until loading completes. This method provides a simple substitute for the conventional
"if cached, return; otherwise create, cache and return" pattern.
Warning: defaultValue
must not evaluate to null
.
Like getWithDefault
, but useful when defaultValue
is expensive to compute
Like getWithDefault
, but useful when defaultValue
is expensive to compute
Associates value
with key
in this cache.
Associates value
with key
in this cache. If the cache previously contained a
value associated with key
, the old value is atomically replaced by value
.
Like put
, but useful when value
is expensive to compute
Like put
, but useful when value
is expensive to compute
Like put
, but also returns value
Like put
, but also returns value
Like putGet
, but useful when value
is expensive to compute
Like putGet
, but useful when value
is expensive to compute
Removes key
from the underlying cache
Removes key
from the underlying cache
if 0 (minutes), cache entries never expire; otherwise specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access.
if 0 (minutes), cache entries never expire; otherwise specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access. Access time is reset by all cache read and write operations.
The underlying Google Guava Cache
instance
The underlying Google Guava Cache
instance