T
- The type contained on the Stream withinpublic class StreamTValue<T> extends java.lang.Object implements StreamT<T>
Modifier and Type | Method and Description |
---|---|
<R> StreamTValue<R> |
empty() |
static <T> StreamTValue<T> |
emptyOptional() |
boolean |
equals(java.lang.Object o) |
StreamTValue<T> |
filter(java.util.function.Predicate<? super T> test)
Filter the wrapped Stream
|
<B> StreamTValue<B> |
flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends B>> f) |
<B> StreamTValue<B> |
flatMapT(java.util.function.Function<? super T,StreamTValue<? extends B>> f)
Flat Map the wrapped Stream
|
static <A> StreamTValue<A> |
fromAnyM(AnyMValue<A> anyM)
|
static <A,V extends MonadicValue<? extends java.util.stream.Stream<A>>> |
fromValue(V monadicValue) |
java.util.stream.Stream<T> |
get() |
int |
hashCode() |
boolean |
isSeqPresent() |
boolean |
isStreamPresent() |
java.util.Iterator<T> |
iterator() |
static <U,R> java.util.function.Function<StreamTValue<U>,StreamTValue<R>> |
lift(java.util.function.Function<? super U,? extends R> fn)
Lift a function into one that accepts and returns an StreamT
This allows multiple monad types to add functionality to existing functions and methods
e.g.
|
<B> StreamTValue<B> |
map(java.util.function.Function<? super T,? extends B> f)
Map the wrapped Stream
|
AnyM<? extends CyclopsCollectable<T>> |
nestedCollectables() |
AnyM<? extends IterableFoldable<T>> |
nestedFoldables() |
static <A> StreamTValue<A> |
of(AnyMValue<? extends java.util.stream.Stream<A>> monads)
Create a StreamT from an AnyM that wraps a monad containing a Stream
|
static <A> StreamTValue<A> |
of(java.util.stream.Stream<A> monads) |
StreamTValue<T> |
peek(java.util.function.Consumer<? super T> peek)
Peek at the current value of the Stream
|
ReactiveSeq<T> |
stream() |
java.lang.String |
toString() |
AnyM<? extends Traversable<T>> |
transformerStream() |
<T> StreamTValue<T> |
unit(T unit) |
<T> StreamTValue<T> |
unitAnyM(AnyM<Traversable<T>> traversable) |
<U> StreamTValue<U> |
unitIterator(java.util.Iterator<U> u) |
AnyMValue<ReactiveSeq<T>> |
unwrap() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
bind, cast, combine, cycle, cycle, cycleUntil, cycleWhile, distinct, dropRight, dropUntil, dropWhile, emptyStream, filterNot, fromAnyM, fromAnyMSeq, fromAnyMValue, fromFuture, fromIterable, fromIterableValue, fromOptional, fromPublisher, fromStream, grouped, grouped, grouped, grouped, groupedStatefullyUntil, groupedUntil, groupedUntil, groupedWhile, groupedWhile, intersperse, limit, limitLast, limitUntil, limitWhile, notNull, of, ofType, onEmpty, onEmptyGet, onEmptyThrow, patternMatch, reverse, scanLeft, scanLeft, scanRight, scanRight, shuffle, shuffle, skip, skipLast, skipUntil, skipWhile, slice, sliding, sliding, sorted, sorted, sorted, takeRight, takeUntil, takeWhile, trampoline, zip, zip, zip, zip, zip, zip, zip3, zip4, zipWithIndex
futureOperations, lazyOperations, subscribe
seq, toCompletableFuture, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFutureStream, toFutureStream, toFutureW, toIor, toIorSecondary, toListX, toMapX, toMaybe, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toStreamable, toTry, toValue, toValueMap, toValueSet, toXor, toXorSecondary
traversable
fixedDelay, onePer, xPer
futureStream, getStreamable, isEmpty, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStream
endsWith, endsWithIterable, findFirst, firstValue, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, headAndTail, join, join, join, mapReduce, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, visit
allMatch, anyMatch, collect, collect, listT, noneMatch, setT, streamableT, streamT, toListOfLists, toNestedListX, toNestedSetX, toSetOfSets
public AnyMValue<ReactiveSeq<T>> unwrap()
public boolean isSeqPresent()
isSeqPresent
in interface TransformerSeq<T>
public StreamTValue<T> peek(java.util.function.Consumer<? super T> peek)
StreamT.of(AnyM.fromStream(Arrays.asStream(10))
.peek(System.out::println);
//prints 10
public StreamTValue<T> filter(java.util.function.Predicate<? super T> test)
StreamT.of(AnyM.fromStream(Arrays.asStream(10,11))
.filter(t->t!=10);
//StreamT<AnyM<Stream<Stream[11]>>>
filter
in interface StreamT<T>
filter
in interface Filterable<T>
filter
in interface FilterableFunctor<T>
test
- Predicate to filter the wrapped Streampublic <B> StreamTValue<B> map(java.util.function.Function<? super T,? extends B> f)
StreamT.of(AnyM.fromStream(Arrays.asStream(10))
.map(t->t=t+1);
//StreamT<AnyM<Stream<Stream[11]>>>
public <B> StreamTValue<B> flatMapT(java.util.function.Function<? super T,StreamTValue<? extends B>> f)
StreamT.of(AnyM.fromStream(Arrays.asStream(10))
.flatMap(t->Stream.empty();
//StreamT<AnyM<Stream<Stream.empty>>>
f
- FlatMap functionpublic <B> StreamTValue<B> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends B>> f)
public static <U,R> java.util.function.Function<StreamTValue<U>,StreamTValue<R>> lift(java.util.function.Function<? super U,? extends R> fn)
Function<Integer,Integer> add2 = i -> i+2;
Function<StreamT<Integer>, StreamT<Integer>> optTAdd2 = StreamT.lift(add2);
Stream<Integer> nums = Stream.of(1,2);
AnyM<Stream<Integer>> stream = AnyM.fromOptional(Optional.of(nums));
List<Integer> results = optTAdd2.apply(StreamT.of(stream))
.unwrap()
.<Optional<Stream<Integer>>>unwrap()
.get()
.collect(Collectors.toList());
//Stream.of(3,4);
public static <A> StreamTValue<A> fromAnyM(AnyMValue<A> anyM)
anyM
- AnyM that doesn't contain a monad wrapping an Streampublic static <A> StreamTValue<A> of(AnyMValue<? extends java.util.stream.Stream<A>> monads)
monads
- public static <A> StreamTValue<A> of(java.util.stream.Stream<A> monads)
public static <A,V extends MonadicValue<? extends java.util.stream.Stream<A>>> StreamTValue<A> fromValue(V monadicValue)
public boolean isStreamPresent()
public java.util.stream.Stream<T> get()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator<T> iterator()
public <U> StreamTValue<U> unitIterator(java.util.Iterator<U> u)
unitIterator
in interface StreamT<T>
public <T> StreamTValue<T> unit(T unit)
public ReactiveSeq<T> stream()
stream
in interface FoldableTransformerSeq<T>
stream
in interface TransformerSeq<T>
stream
in interface NestedFoldable<T>
stream
in interface Sequential<T>
stream
in interface ConvertableSequence<T>
stream
in interface ToStream<T>
stream
in interface Traversable<T>
public <R> StreamTValue<R> empty()
public static <T> StreamTValue<T> emptyOptional()
public AnyM<? extends IterableFoldable<T>> nestedFoldables()
nestedFoldables
in interface NestedFoldable<T>
public AnyM<? extends CyclopsCollectable<T>> nestedCollectables()
nestedCollectables
in interface NestedCollectable<T>
public <T> StreamTValue<T> unitAnyM(AnyM<Traversable<T>> traversable)
unitAnyM
in interface TransformerSeq<T>
public AnyM<? extends Traversable<T>> transformerStream()
transformerStream
in interface TransformerSeq<T>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object