Interface CacheKey<K>

  • Type Parameters:
    K - type parameter indicating the type of the input key
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface CacheKey<K>
    Function that is invoked on input keys of type K to derive keys that are required by the CacheMap implementation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.Object getKey​(K input)
      Returns the cache key that is created from the provided input key.
      default java.lang.Object getKeyWithContext​(K input, java.lang.Object context)
      Returns the cache key that is created from the provided input key and context.
    • Method Detail

      • getKey

        java.lang.Object getKey​(K input)
        Returns the cache key that is created from the provided input key.
        Parameters:
        input - the input key
        Returns:
        the cache key
      • getKeyWithContext

        default java.lang.Object getKeyWithContext​(K input,
                                                   java.lang.Object context)
        Returns the cache key that is created from the provided input key and context.
        Parameters:
        input - the input key
        context - the context
        Returns:
        the cache key