I'm setting up my cache like that:
Cache<String,MyClass> cache = CacheBuilder.newBuilder().expireAfterAccess( 16l, TimeUnit.MINUTES ).build()
and
class MyClass {
String name
boolean canExpire
}
I want the instances with canExpire = true
be expired regurarly, but those with false
not.
Is there any standard / straight-forward way to achieve such behaviour?