enonic / lib-cache

Cache Library for Enonic XP.
Apache License 2.0
2 stars 1 forks source link

Implement a wrapper to getIfPresent method #10

Closed tomanders closed 8 months ago

tomanders commented 4 years ago

Hi, as of now I'm trying to to debugging of our caching mechanism and checking for existence of different objects. Since I just have the get-method available I have to provide a callback which modifies the cache. Which makes it harder to do debugging since I'm actually changing the cache if the object isn't present.

It would be great to have a wrapper to getIfPresent method (https://guava.dev/releases/21.0/api/docs/com/google/common/cache/Cache.html#getIfPresent-java.lang.Object-) so I could do cache checks without side effects.

Thanks.