public class StreamBasedNary<T> extends NarySupport<T>
Created by kfgodel on 07/03/16.
Stream.Builder<T>| Constructor and Description |
|---|
StreamBasedNary() |
| Modifier and Type | Method and Description |
|---|---|
protected Stream<T> |
asStream()
Gets a stream with the elements of this instance.
|
List<T> |
collectToList()
Returns the content of this nary in a list.
This method is a shorthand of calling collect(Collectors.toList()). This nary, as stream, will be consumed in the operation. |
Set<T> |
collectToSet()
Returns the content of this nary in a set.
This method is a shorthand of calling collect(Collectors.toSet()) This nary, as stream, will be consumed in the operation. |
static <T> StreamBasedNary<T> |
create(Stream<? extends T> source) |
String |
toString()
This method is redefined so whenever possible, the contained elements are printed
|
Unary<T> |
unique()
Treats this instance as having a single element.
|
add, allMatch, anyMatch, close, collect, collect, collect, concat, concat, count, distinct, equals, filter, findAny, findAnyNary, findFirst, findFirstNary, findLast, flatMap, flatMapOptional, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, hashCode, isParallel, iterator, limit, map, mapFilteringNullResult, mapToDouble, mapToInt, mapToLong, max, maxNary, min, minNary, noneMatch, onClose, parallel, peek, reduce, reduce, reduce, reduceNary, returningNaryDo, returningNaryDo, sequential, skip, sorted, sorted, spliterator, toArray, toArray, unorderedclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static <T> StreamBasedNary<T> create(Stream<? extends T> source)
public Unary<T> unique() throws MoreThanOneElementException
MultiElementUnary
because expectations between runtime and compile time won't matchMoreThanOneElementException - If this instance has more than one elementpublic List<T> collectToList()
MultiElementpublic Set<T> collectToSet()
MultiElementprotected Stream<T> asStream()
NarySupportasStream in class NarySupport<T>Copyright © 2020. All rights reserved.