MCPcopy Create free account
hub / github.com/antlr/codebuff / expireAfterAccess

Method expireAfterAccess

output/java_guava/1.4.13/CacheBuilder.java:670–677  ·  view source on GitHub ↗

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 {@code Cache.asMap().get(Object)

(long duration, TimeUnit unit)

Source from the content-addressed store, hash-verified

668
669
670 public CacheBuilder<K, V> expireAfterAccess(long duration, TimeUnit unit) {
671 checkState(expireAfterAccessNanos == UNSET_INT,
672 "expireAfterAccess was already set to %s ns",
673 expireAfterAccessNanos);
674 checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
675 this.expireAfterAccessNanos = unit.toNanos(duration);
676 return this;
677 }
678
679 long getExpireAfterAccessNanos() {
680 return (expireAfterAccessNanos == UNSET_INT)

Callers 2

toCacheBuilderMethod · 0.45
recreateCacheBuilderMethod · 0.45

Calls 2

checkStateMethod · 0.45
checkArgumentMethod · 0.45

Tested by

no test coverage detected