Class Cache.Builder<K,V>
java.lang.Object
com.codename1.backend.Cache.Builder<K,V>
A cache's settings. Nothing is bounded or expires unless asked.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()clock(Cache.Clock clock) The time source; the default is the monotonic system clock.expireAfterAccessMillis(long millis) Entries expire this long after they were last read or stored.expireAfterWriteMillis(long millis) Entries expire this long after they are stored.expiry(Cache.Expiry<K, V> expiry) Each entry's lifetime from its write, chosen byexpiry.maximumSize(long entries) At mostentriesentries.maximumWeight(long weight, Cache.Weigher<K, V> weigher) At mostweightin total, asweigherweighs entries.removalListener(Cache.RemovalListener<K, V> listener) Told about every removal; see the class description.
-
Method Details
-
maximumSize
At mostentriesentries. ExcludesmaximumWeight. -
maximumWeight
At mostweightin total, asweigherweighs entries. ExcludesmaximumSize. -
expireAfterWriteMillis
Entries expire this long after they are stored. -
expireAfterAccessMillis
Entries expire this long after they were last read or stored. -
expiry
Each entry's lifetime from its write, chosen byexpiry. -
removalListener
Told about every removal; see the class description. -
clock
The time source; the default is the monotonic system clock. -
build
-