org.springframework.cache.interceptor

Interface KeyGenerator

  • All Known Implementing Classes:
    SimpleKeyGenerator
    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 KeyGenerator
    Cache key generator. Used for creating a key based on the given method (used as context) and its parameters.
    Since:
    3.1
    Author:
    Costin Leau, Chris Beams, Phillip Webb
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.lang.Object generate(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object... params)
      Generate a key for the given method and its parameters.
    • Method Detail

      • generate

        java.lang.Object generate(java.lang.Object target,
                                  java.lang.reflect.Method method,
                                  java.lang.Object... params)
        Generate a key for the given method and its parameters.
        Parameters:
        target - the target instance
        method - the method being called
        params - the method parameters (with any var-args expanded)
        Returns:
        a generated key