| Modifier and Type | Class and Description |
|---|---|
static interface |
Suppliers.Lazy<T> |
| Modifier and Type | Method and Description |
|---|---|
static <T,V> Supplier<T> |
adapted(Supplier<V> supplier,
Function<V,T> adaptor)
Creates a new
Supplier that applies the specified function to the values obtained from a source supplier. |
static <T,E extends Exception> |
compose(ThrowingSupplier<T,? extends E> input,
ThrowingPredicate<T,? extends E> predicate) |
static <T> Suppliers.Lazy<T> |
lazySingleton(Supplier<T> supplier)
Creates a lazy initialized
Supplier of a single object |
static <T> Supplier<T> |
singleton(T instance)
Creates a
Supplier that returns a single object |
static BooleanSupplier |
untilTimeExpired(long duration,
TimeUnit unit) |
public static <T> Supplier<T> singleton(T instance)
Supplier that returns a single objectT - The object typeinstance - The object to returnSupplier returning the specified object instancepublic static <T> Suppliers.Lazy<T> lazySingleton(Supplier<T> supplier)
Supplier of a single objectT - The object typesupplier - A supplier that will provide the object when requiredSupplier returning the specified object instancepublic static <T,V> Supplier<T> adapted(Supplier<V> supplier, Function<V,T> adaptor)
Supplier that applies the specified function to the values obtained from a source supplier. The
function is only invoked once for every sequence of identical objects obtained from the source supplier (the previous result
is cached and returned again if the source object hasn't changed).V - The source object typeT - The result object typesupplier - A supplier of source objectsadaptor - A function mapping source objects to result objectsSupplier of objectspublic static <T,E extends Exception> com.mware.ge.function.Suppliers.ThrowingCapturingSupplier<T,E> compose(ThrowingSupplier<T,? extends E> input, ThrowingPredicate<T,? extends E> predicate)
public static BooleanSupplier untilTimeExpired(long duration, TimeUnit unit)
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.