@Deprecated
public abstract class Suppliers
extends java.lang.Object
Suppliers to Iterables and other types of
collections.| Modifier and Type | Method and Description |
|---|---|
static <T> Supplier<T> |
collect(java.util.List<Supplier<T>> suppliers)
Deprecated.
Create a
Supplier that aggregates the given list of suppliers by calling each one, in
turn, until the supplier returns null. |
static <T> Supplier<T> |
drain(java.lang.Iterable<T> c)
Deprecated.
Create a
Supplier which drains the contents of the given Iterable by
internally creating an Iterator and delegating each call of Supplier.get() to Iterator.next(). |
static <T> Supplier<T> |
drainAll(java.lang.Iterable<java.lang.Iterable<T>> iters)
Deprecated.
Create a
Supplier which drains all of the given Iterables. |
static <T> Supplier<T> |
filter(java.lang.Iterable<T> src,
Predicate<T> predicate)
Deprecated.
Filter the given
Iterable using the given Predicate so that calls to the return Supplier.get() will provide only items from the original collection which pass the predicate
test. |
static <T> Supplier<T> |
roundRobin(T... objs)
Deprecated.
Create a
Supplier that continually round-robin load balances each call to Supplier.get() by iterating over the objects. |
static <T> Supplier<T> |
supply(T obj)
Deprecated.
Wrap the given object that will supply the given object every time
Supplier.get() is
called. |
static <T> Supplier<T> |
supplyOnce(T obj)
Deprecated.
Supply the given object only once, the first time
Supplier.get() is invoked. |
static <T> Supplier<T> |
supplyWhile(T obj,
Predicate<T> predicate)
Deprecated.
Supply the given object to callers only as long as the given
Predicate returns true. |
public static <T> Supplier<T> supply(T obj)
Supplier.get() is
called.T - type of the supplied objectobj - the object to supplySupplierpublic static <T> Supplier<T> supplyOnce(T obj)
Supplier.get() is invoked.T - type of the supplied objectobj - the object to supplySupplierpublic static <T> Supplier<T> supplyWhile(T obj, Predicate<T> predicate)
Predicate returns true.T - type of the supplied objectobj - the object to supplypredicate - the predicate to check to determine whether or not to supply the given valueSupplierpublic static <T> Supplier<T> roundRobin(T... objs)
Supplier that continually round-robin load balances each call to Supplier.get() by iterating over the objects. When the end is reached, it wraps around to the first object and
keeps providing objects to callers.T - type of the supplied objectobjs - the objects to load-balanceSupplierpublic static <T> Supplier<T> filter(java.lang.Iterable<T> src, Predicate<T> predicate)
Iterable using the given Predicate so that calls to the return Supplier.get() will provide only items from the original collection which pass the predicate
test.public static <T> Supplier<T> drain(java.lang.Iterable<T> c)
Supplier which drains the contents of the given Iterable by
internally creating an Iterator and delegating each call of Supplier.get() to Iterator.next().T - type of the sourcec - the collection to consumeSupplierpublic static <T> Supplier<T> drainAll(java.lang.Iterable<java.lang.Iterable<T>> iters)
Supplier which drains all of the given Iterables.T - type of the sourceiters - the collections to consumeSupplierdrain(Iterable)public static <T> Supplier<T> collect(java.util.List<Supplier<T>> suppliers)
Supplier that aggregates the given list of suppliers by calling each one, in
turn, until the supplier returns null. The aggregator then goes on to the next supplier in the list and
delegates calls to that supplier, and so on, until the end of the list is reached.T - type of the sourcesuppliers - the list of suppliers to delegate toSupplier