Interface BiCacheEntryCreator<I,K,V,C>

Type Parameters:
I - the identifier type of the cache key
K - the key type of the created entry
V - the value type of the created entry
C - the context of the created entry
All Superinterfaces:
CacheEntryCreator<I,Map.Entry<K,V>,C>

public interface BiCacheEntryCreator<I,K,V,C> extends CacheEntryCreator<I,Map.Entry<K,V>,C>
Creates a pair of entries in a cache.
Author:
Paul Ferraro
  • Method Details

    • createEntry

      Map.Entry<CompletionStage<K>,CompletionStage<V>> createEntry(I id, C context)
      Creates a value in the cache, if it does not already exist.
      Parameters:
      id - the cache entry identifier.
      context - the creation context
      Returns:
      the new value, or the existing value the cache entry already exists.
    • createValueAsync

      default CompletionStage<Map.Entry<K,V>> createValueAsync(I id, C context)
      Description copied from interface: CacheEntryCreator
      Creates a value in the cache, if it does not already exist.
      Specified by:
      createValueAsync in interface CacheEntryCreator<I,K,V>
      Parameters:
      id - the cache entry identifier.
      context - the context of the created value
      Returns:
      the new value, or the existing value the cache entry already exists.