@Deprecated public abstract class Suppliers extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Supplier<T> |
collect(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(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(Iterable<Iterable<T>> iters)
Deprecated.
|
static <T> Supplier<T> |
filter(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 supplySupplier
public static <T> Supplier<T> supplyOnce(T obj)
Supplier.get()
is invoked.T
- type of the supplied objectobj
- the object to supplySupplier
public 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 valueSupplier
public 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-balanceSupplier
public static <T> Supplier<T> filter(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(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 consumeSupplier
public static <T> Supplier<T> drainAll(Iterable<Iterable<T>> iters)
T
- type of the sourceiters
- the collections to consumeSupplier
drain(Iterable)
public static <T> Supplier<T> collect(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
Copyright © 2016. All rights reserved.