public final class BlockingIterables
extends java.lang.Object
BlockingIterable
.Modifier and Type | Method and Description |
---|---|
static <T> BlockingIterable<T> |
emptyBlockingIterable()
|
static <T> BlockingIterable<T> |
from(CloseableIterable<T> iterable)
Convert from a
Iterable to a CloseableIterable . |
static <T> BlockingIterable<T> |
from(java.lang.Iterable<T> iterable)
Convert from a
Iterable to a BlockingIterable . |
static <T> BlockingIterable<T> |
singletonBlockingIterable(T item)
|
public static <T> BlockingIterable<T> emptyBlockingIterable()
T
- The type of items for the BlockingIterable
.BlockingIterable
that generates BlockingIterator
s where
Iterator.hasNext()
returns true
.public static <T> BlockingIterable<T> singletonBlockingIterable(T item)
T
- The type of items for the BlockingIterable
.item
- The item returned by BlockingIterator
s.BlockingIterable
generates BlockingIterator
s that only return a single
item
.public static <T> BlockingIterable<T> from(java.lang.Iterable<T> iterable)
Iterable
to a BlockingIterable
.T
- The type of data.iterable
- The Iterable
to convert.BlockingIterable
.public static <T> BlockingIterable<T> from(CloseableIterable<T> iterable)
Iterable
to a CloseableIterable
.T
- The type of data.iterable
- The Iterable
to convert.CloseableIterable
.