Closed prokop7 closed 3 years ago
@prokop7 Thanks for this PR. I'm willing to merge it as it looks reasonable. Can you look at my little review remarks?
Also, I've fixed the misconfiguration of Cache Interceptor, it requires factoryBean
to be able to get Caches
Issue
@CachableCollection
supports only Collection<?> arguments, it's not ideal for real use, often programmers use Set<?> or List<?>Proposed solution
Replace check
arg[0].class.equals(Collection.class)
withCollection.class.isAssignableFrom(arg[0].class)
.We have to decide what type of collection we have to create. The condition is that
arg[0].class
has to be assignable from this collection. To deal with itCollectionCreator
interface is provided. Currently it consists two implementations:DefaultCollectionCreator
which creates LinkedList,SetCollectionCreator
that works with HashSet