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 @NullMarked @PublicSpi 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

    Modifier and Type
    Method
    Description
    getKey(K input)
    Returns the cache key that is created from the provided input key.
    default Object
    getKeyWithContext(K input, Object context)
    Returns the cache key that is created from the provided input key and context.
  • Method Details

    • getKey

      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 Object getKeyWithContext(K input, 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