Package org.jpos.util
Class Recyclable<T>
- java.lang.Object
-
- org.jpos.util.Recyclable<T>
-
- Type Parameters:
T
- the type of results supplied by this supplier
- All Implemented Interfaces:
java.util.function.Supplier<T>
public class Recyclable<T> extends java.lang.Object implements java.util.function.Supplier<T>
Caches a supplier's result up to approximatelymaxCycles
.After approximately
maxCycles
calls to itsget()
operation,Recyclable
fetches a new result from its underlying Supplier.- Since:
- 2.1.3
-
-
Constructor Summary
Constructors Constructor Description Recyclable(java.util.function.Supplier<T> supplier, long maxCycles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
-
-
-
Constructor Detail
-
Recyclable
public Recyclable(java.util.function.Supplier<T> supplier, long maxCycles)
-
-