Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public interface Cache.Expiry<K, V>

A lifetime chosen per entry, from when it is written.

Methods

public abstract long millisToLive(K key, V value)Milliseconds the entry lives after being stored, or Long.MAX_VALUE for no limit.

Method details

millisToLive

public abstract long millisToLive(K key, V value)
Milliseconds the entry lives after being stored, or Long.MAX_VALUE for no limit. Overrides Cache.Builder.expireAfterWriteMillis for this entry; Cache.Builder.expireAfterAccessMillis still applies. Zero or less means the value is not stored, and any old value for the key is removed; a Cache.get of such a value calls its loader every time.