@FunctionalInterface public interface Streamable<T> extends Iterable<T>
Iterables.| Modifier and Type | Method and Description |
|---|---|
static <T> Streamable<T> |
empty()
Returns an empty
Streamable. |
default Streamable<T> |
filter(Predicate<? super T> predicate)
Returns a new
Streamable that will apply the given filter Predicate to the current one. |
default <R> Streamable<R> |
flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
Returns a new
Streamable that will apply the given Function to the current one. |
default <R> Streamable<R> |
map(Function<? super T,? extends R> mapper)
Returns a new
Streamable that will apply the given Function to the current one. |
static <T> Streamable<T> |
of(Iterable<T> iterable)
Returns a
Streamable for the given Iterable. |
static <T> Streamable<T> |
of(Supplier<? extends Stream<T>> supplier) |
static <T> Streamable<T> |
of(T... t)
Returns a
Streamable with the given elements. |
default Stream<T> |
stream()
|
forEach, iterator, spliteratorstatic <T> Streamable<T> empty()
Streamable.@SafeVarargs static <T> Streamable<T> of(T... t)
Streamable with the given elements.t - the elements to return.static <T> Streamable<T> of(Iterable<T> iterable)
Streamable for the given Iterable.iterable - must not be null.static <T> Streamable<T> of(Supplier<? extends Stream<T>> supplier)
default <R> Streamable<R> map(Function<? super T,? extends R> mapper)
Streamable that will apply the given Function to the current one.mapper - must not be null.Stream.map(Function)default <R> Streamable<R> flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
Streamable that will apply the given Function to the current one.mapper - must not be null.Stream.flatMap(Function)default Streamable<T> filter(Predicate<? super T> predicate)
Streamable that will apply the given filter Predicate to the current one.predicate - must not be null.Stream.filter(Predicate)Copyright © 2011-2016–2017 Pivotal Software, Inc.. All rights reserved.