Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

customized cache key java

public class CustomKeyGenerator implements KeyGenerator {
 
    public Object generate(Object target, Method method, Object... params) {
        return target.getClass().getSimpleName() + "_"
          + method.getName() + "_"
          + StringUtils.arrayToDelimitedString(params, "_");
    }
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #customized #cache #key #java
ADD COMMENT
Topic
Name
7+8 =