Class BlockingIterables
- java.lang.Object
-
- io.servicetalk.concurrent.internal.BlockingIterables
-
public final class BlockingIterables extends java.lang.ObjectUtility methods forBlockingIterable.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> BlockingIterable<T>emptyBlockingIterable()static <T> BlockingIterable<T>from(CloseableIterable<T> iterable)Convert from aIterableto aCloseableIterable.static <T> BlockingIterable<T>from(java.lang.Iterable<T> iterable)Convert from aIterableto aBlockingIterable.static <T> BlockingIterable<T>singletonBlockingIterable(T item)
-
-
-
Method Detail
-
emptyBlockingIterable
public static <T> BlockingIterable<T> emptyBlockingIterable()
- Type Parameters:
T- The type of items for theBlockingIterable.- Returns:
- a
BlockingIterablethat generatesBlockingIterators whereIterator.hasNext()returnstrue.
-
singletonBlockingIterable
public static <T> BlockingIterable<T> singletonBlockingIterable(T item)
- Type Parameters:
T- The type of items for theBlockingIterable.- Parameters:
item- The item returned byBlockingIterators.- Returns:
- a new
BlockingIterablegeneratesBlockingIterators that only return a singleitem.
-
from
public static <T> BlockingIterable<T> from(java.lang.Iterable<T> iterable)
Convert from aIterableto aBlockingIterable.- Type Parameters:
T- The type of data.- Parameters:
iterable- TheIterableto convert.- Returns:
- The
BlockingIterable.
-
from
public static <T> BlockingIterable<T> from(CloseableIterable<T> iterable)
Convert from aIterableto aCloseableIterable.- Type Parameters:
T- The type of data.- Parameters:
iterable- TheIterableto convert.- Returns:
- The
CloseableIterable.
-
-