K
- the key type.V
- the value type.public interface ValueFactory<K,V>
Cache
.Modifier and Type | Method and Description |
---|---|
ValueFactoryResult<V> |
create(K key)
Creates a
ValueFactoryResult based on the key. |
ValueFactoryResult<V> create(K key)
ValueFactoryResult
based on the key. This is called when
ServiceEvents.setLoadObjectHandler(Cache, ValueFactory)
fires an event,
supplied to Cache.readOrAdd(Object, ValueFactory, ReadPolicy)
and the object doesn't exist, or
Cache.readOrAddAsync(Object, ValueFactory, ReadPolicy)
and the object doesn't exist.key
- the key.