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

Method expireAfterWrite

output/java_guava/1.4.13/CacheBuilder.java:631–638  ·  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, or the most recent replacement of its value. When duration is zero, this method hands off to #maximumSize(long) maximumSize(0), ignoring

(long duration, TimeUnit unit)

Source from the content-addressed store, hash-verified

629
630
631 public CacheBuilder<K, V> expireAfterWrite(long duration, TimeUnit unit) {
632 checkState(expireAfterWriteNanos == UNSET_INT,
633 "expireAfterWrite was already set to %s ns",
634 expireAfterWriteNanos);
635 checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
636 this.expireAfterWriteNanos = unit.toNanos(duration);
637 return this;
638 }
639
640 long getExpireAfterWriteNanos() {
641 return (expireAfterWriteNanos == UNSET_INT)

Callers 2

toCacheBuilderMethod · 0.45
recreateCacheBuilderMethod · 0.45

Calls 2

checkStateMethod · 0.45
checkArgumentMethod · 0.45

Tested by

no test coverage detected