Interface AsyncWarmUpCache<K,​V>

  • All Known Implementing Classes:
    WidgetAsyncWarmUpCache

    public interface AsyncWarmUpCache<K,​V>
    A cache performing asynchronous warming up.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Clears whole cache.
      V get​(K key)
      Gets cached value for specified key.
      V get​(K key, java.util.function.Supplier<V> defaultValue)
      Gets cached value for specified key.
      boolean has​(K key)
      Checks whether a value for specified key is cached.
      void revoke​(K key)
      Removes a value cached for specified key.
      void warmUp​(java.util.Iterator<java.util.Collection<K>> keys, java.util.function.Function<K,​V> values)
      Triggers asynchronous cache warm up.
    • Method Detail

      • warmUp

        void warmUp​(java.util.Iterator<java.util.Collection<K>> keys,
                    java.util.function.Function<K,​V> values)
        Triggers asynchronous cache warm up.
        Parameters:
        keys - iterator over keys to be processed
        values - value provider
      • has

        boolean has​(K key)
        Checks whether a value for specified key is cached.
        Parameters:
        key - value key
        Returns:
        true if value is cached
      • get

        V get​(K key)
        Gets cached value for specified key.
        Parameters:
        key - value key
        Returns:
        value for key
      • get

        V get​(K key,
              java.util.function.Supplier<V> defaultValue)
        Gets cached value for specified key. If cache has no value for specified key, default value provider is asked for it.
        Parameters:
        key - value key
        defaultValue - a supplier for a result in case value is not cached
        Returns:
        value for key
      • revoke

        void revoke​(K key)
        Removes a value cached for specified key.
        Parameters:
        key - value key
      • clear

        void clear()
        Clears whole cache.