Add java.time.Duration overloads to Suppliers.memoizeWithExpiration()
See original GitHub issueSuppliers.memoizeWithExpiration()
takes a TimeUnit
. Consider adding a java.time.Duration
overload similar to what you did with CacheBuilder
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Suppliers.memoizeWithExpiration should take a duration ...
The Suppliers.memoizeWithExpiration function currently takes a fixed duration as an argument. I have a use case in a Jenkins plugin ...
Read more >Introduction to Guava Memoizer - Baeldung
There are two methods in the Suppliers class that enable memoization: memoize, and memoizeWithExpiration. When we want to execute the memoized ...
Read more >Suppliers Utility Class In Google Guava
Memoize with expiration. There is an overloaded memoize method which takes an expiration input (duration and its unit). Within this duration ...
Read more >Suppliers (Guava: Google Core Libraries for Java 19.0 API)
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed. static...
Read more >Guava: Google Core Libraries for Java 24.1.1-android API
add (String, Object) - Method in class com.google.common.base. ... Calls next() on iterator , either numberToAdvance times or until hasNext() returns false ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kluever My 2 cents: all Guava APIs that expect a
c.g.c.b.Supplier
argument should allowj.u.f.Supplier
as well. Where they don’t already do so, overloads should be added. I would even go so far as formally deprecatingc.g.c.b.Supplier
explicitly.Once this is done, I see no benefit in returning
com.google.common.base.Supplier
.@nikhilbarar thanks for the offer, but I actually have a pending change out for this - we just need to work through the Guava Supplier vs. JDK Supplier issue.