I am using Guava LoadingCache to bulk load all elements at once into my eager cache. But the implementation of the loadAll method that I'm supplying does not really need an Iterable<? extends K> keys argument, since my DAO does not except any parameters either - my DAO method returns generic Map<K,V>.
Since my implementation is generic, I'm using generics to do a call on getAllIterable(<? extends K> keys_), but because of the type erasure, I can not instantiate K key, and pass it to getAll, since it does not expect any non null keys.
Does anyone know of any workaround around this?
Mapof everything you ought to have in your cache to start with, without querying any specific keys? Or are you trying to get out all values from your cache without querying a specific key? - Louis Wasserman.get()any key on demand is what aLoadingCacheis for - fge