@SuppressWarnings("unchecked") private Set<String> resolveCachingCacheNames(AnnotatedElement annotatedElement) { Set<String> cacheNames = new HashSet<>(); Optional.ofNullable(resolveAnnotation(annotatedElement, Caching.class)).ifPresent(caching -> concat(stream(caching.cacheable()), stream(caching.evict()), stream(caching.put())) .flatMap(cacheAnnotation -> resolveCacheNames(cacheAnnotation).stream()) .collect(Collectors.toCollection(() -> cacheNames))); return cacheNames; } }
@SuppressWarnings("unchecked") private Set<String> resolveCachingCacheNames(AnnotatedElement annotatedElement) { Set<String> cacheNames = new HashSet<>(); Optional.ofNullable(resolveAnnotation(annotatedElement, Caching.class)).ifPresent(caching -> concat(stream(caching.cacheable()), stream(caching.evict()), stream(caching.put())) .flatMap(cacheAnnotation -> resolveCacheNames(cacheAnnotation).stream()) .collect(Collectors.toCollection(() -> cacheNames))); return cacheNames; } }