public class SupplierUtil extends java.lang.Object
Helper methods for dealing with java.util.function.Supplier.
Modifiers | Name | Description |
---|---|---|
java.util.function.Supplier<T> |
delegate |
|
java.util.function.Supplier<T> |
delegate |
|
boolean |
initialized |
|
boolean |
initialized |
Type Params | Return Type | Name and description |
---|---|---|
|
public T |
get() |
|
public T |
get() |
|
private T |
initialize() |
|
private T |
initialize() |
<T> |
public static java.util.function.Supplier<T> |
memoized(java.util.function.Supplier<T> actual) Caches the result of supplier in a thread safe manner. |
<T> |
public static java.util.function.Supplier<T> |
memoizedNonEmpty(java.util.function.Supplier<T> actual) Caches the result of supplier in a thread safe manner. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Caches the result of supplier in a thread safe manner.
actual
- The supplier providing the resultT
- The type of resultCaches the result of supplier in a thread safe manner. The result is only cached if it is non null or non empty if an optional.
actual
- The supplier providing the resultT
- The type of result