public abstract class StreamUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> @NotNull Collector<T,?,ArrayDeque<T>> |
collectToDequeue()
A stream collecetor to a ArrayDeque type
|
@NotNull Stream<String> |
rows(@NotNull String text)
Read a String.
|
static Stream<String> |
rowsOfUrl(@NotNull URL url)
Returns a stream of lines form URL resource
|
static <D,R> @NotNull Joinable<D,R> |
toJoinable(@NotNull Function<D,R> fce)
Create a joinable function
Usage
Function<Person, String> nameProvider = Joinable
.of (Person::getBoss)
.add(Person::getBoss)
.add(Person::getName);
String superBossName = nameProvider.apply(getPerson());
|
static <T> Stream<T> |
toStream(@NotNull Iterator<T> iterator)
Convert an interator to a Stream
|
static <T> Stream<T> |
toStream(@NotNull Iterator<T> iterator,
boolean parallel)
Convert an interator to a Stream
|
@NotNull public @NotNull Stream<String> rows(@NotNull @NotNull String text)
public static Stream<String> rowsOfUrl(@NotNull @NotNull URL url) throws IOException
url - An URL link to a resourceIOExceptionpublic static <T> Stream<T> toStream(@NotNull @NotNull Iterator<T> iterator)
T - An item typeiterator - Source iteratorpublic static <T> Stream<T> toStream(@NotNull @NotNull Iterator<T> iterator, boolean parallel)
T - An item typeiterator - Source iteratorparallel - Parrallell processing is enabled@NotNull public static <T> @NotNull Collector<T,?,ArrayDeque<T>> collectToDequeue()
@NotNull public static <D,R> @NotNull Joinable<D,R> toJoinable(@NotNull @NotNull Function<D,R> fce)
Function<Person, String> nameProvider = Joinable
.of (Person::getBoss)
.add(Person::getBoss)
.add(Person::getName);
String superBossName = nameProvider.apply(getPerson());
D - Domain valueR - Result valuefce - An original functionCopyright 2015, Pavel Ponec