@SuppressWarnings("unchecked") private static Object doGenerate(KeyGenerator keyGenerator, CacheKeyInvocationContext<?> context) { List<Object> parameters = new ArrayList<>(); for (CacheInvocationParameter param : context.getKeyParameters()) { Object value = param.getValue(); if (param.getParameterPosition() == context.getAllParameters().length - 1 && context.getMethod().isVarArgs()) { parameters.addAll((List<Object>) CollectionUtils.arrayToList(value)); } else { parameters.add(value); } } return keyGenerator.generate(context.getTarget(), context.getMethod(), parameters.toArray()); }
@SuppressWarnings("unchecked") private static Object doGenerate(KeyGenerator keyGenerator, CacheKeyInvocationContext<?> context) { List<Object> parameters = new ArrayList<>(); for (CacheInvocationParameter param : context.getKeyParameters()) { Object value = param.getValue(); if (param.getParameterPosition() == context.getAllParameters().length - 1 && context.getMethod().isVarArgs()) { parameters.addAll((List<Object>) CollectionUtils.arrayToList(value)); } else { parameters.add(value); } } return keyGenerator.generate(context.getTarget(), context.getMethod(), parameters.toArray()); }
@Override public GeneratedCacheKey generateCacheKey(final CacheKeyInvocationContext<? extends Annotation> cacheKeyInvocationContext) { return new GeneratedCacheKeyImpl(new String[]{ EmptyKeyKeyGenerator.class.getName() + "_@_" + cacheKeyInvocationContext.getMethod().getName() }); } }
@SuppressWarnings("unchecked") private static Object doGenerate(KeyGenerator keyGenerator, CacheKeyInvocationContext<?> context) { List<Object> parameters = new ArrayList<Object>(); for (CacheInvocationParameter param : context.getKeyParameters()) { Object value = param.getValue(); if (param.getParameterPosition() == context.getAllParameters().length - 1 && context.getMethod().isVarArgs()) { parameters.addAll((List<Object>) CollectionUtils.arrayToList(value)); } else { parameters.add(value); } } return keyGenerator.generate(context.getTarget(), context.getMethod(), parameters.toArray()); }