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 (including
Cache.asMap().get(Object) and
Cache.asMap().put(K, V)), but not by operations
on the collection-views of @link Cache#asMap}.
When
duration is zero, this method hands off to
#maximumSize(long) (0), ignoring any otherwise-specificed maximum
size or weight. This can be useful in testing, or to disable caching temporarily without a code
change.
Expired entries may be counted in @link Cache#size}, but will never be visible to read or
write operations. Expired entries are cleaned up as part of the routine maintenance described
in the class javadoc.