| Constructor and Description |
|---|
Suppliers() |
| 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> Supplier<Boolean> |
compose(Supplier<T> input,
Predicate<T> predicate) |
static <T> Supplier<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 |
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> Supplier<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 objectsCopyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.