Class ComposedStreams
- java.lang.Object
-
- org.streamingpool.core.service.streamid.factory.ComposedStreams
-
@Deprecated public final class ComposedStreams extends java.lang.ObjectDeprecated.Factory class which providesStreamIds that identify general purposePublishers based on stream composition. This class is experimental.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <X> StreamId<X>delayedStream(StreamId<X> sourceStreamId, java.time.Duration duration)Deprecated.static <X> StreamId<X>filteredStream(StreamId<X> sourceStreamId, java.util.function.Predicate<X> predicate)Deprecated.static <X,T>
StreamId<T>flatMappedStream(StreamId<X> sourceStreamId, java.util.function.Function<X,org.reactivestreams.Publisher<T>> conversion)Deprecated.static <X,T>
StreamId<T>mappedStream(StreamId<X> sourceStreamId, java.util.function.Function<X,T> conversion)Deprecated.static <X> StreamId<X>mergedStream(java.util.List<StreamId<X>> sourceStreamIds)Deprecated.static <X,T>
StreamId<T>zippedStream(StreamId<X> sourceStreamId1, StreamId<X> sourceStreamId2, java.util.function.BiFunction<X,X,java.util.Optional<T>> zip)Deprecated.
-
-
-
Method Detail
-
mappedStream
public static final <X,T> StreamId<T> mappedStream(StreamId<X> sourceStreamId, java.util.function.Function<X,T> conversion)
Deprecated.Creates aStreamIdthat will be used to create aPublisherwhich will emit items based on aPublisheridentified by the providedStreamId. The conversion function always returns anOptional, if the value is present then it will be emitted, otherwise nothing will be emitted.- Parameters:
sourceStreamId-StreamIdwhich identifies aPublisherthat will be used as the source of the converted objects.conversion-Functionused to convert the objects.- Returns:
- A
StreamId. - Throws:
java.lang.NullPointerException- If the provided source stream id or conversion function are null.- See Also:
MapCompositionFunction
-
flatMappedStream
public static final <X,T> StreamId<T> flatMappedStream(StreamId<X> sourceStreamId, java.util.function.Function<X,org.reactivestreams.Publisher<T>> conversion)
Deprecated.EXPERIMENTAL Creates aStreamIdthat will identify aPublisherwhich will emit items based on aPublisheridentified by the providedStreamId. The conversion function always returns aPublisherwhich will used as the source of the objects to be flattened, if the stream emits values then these will be emitted, otherwise nothing will be emitted.- Parameters:
sourceStreamId-StreamIdwhich identifies thePublisherthat will be used as the source of the converted objects.conversion-Functionused to convert the objects.- Returns:
- A
StreamId. - Throws:
java.lang.NullPointerException- If the provided source stream id or conversion function are null.- See Also:
FlatMapCompositionFunction
-
mergedStream
public static final <X> StreamId<X> mergedStream(java.util.List<StreamId<X>> sourceStreamIds)
Deprecated.
-
filteredStream
public static final <X> StreamId<X> filteredStream(StreamId<X> sourceStreamId, java.util.function.Predicate<X> predicate)
Deprecated.Creates aStreamIdthat will be used to create aPublisherwhich will filter and re-emit the items emitted by thePublishers identified by the providedStreamId.- Parameters:
sourceStreamId-StreamIdwhich identifies thePublisherthat will be used as the source of the filtered objects.predicate-Predicatethat will be used to filter the items emitted by the source.- Returns:
- A
StreamId. - Throws:
java.lang.NullPointerException- If the provided source stream id or predicate are null.- See Also:
FilterCompositionFunction
-
delayedStream
public static final <X> StreamId<X> delayedStream(StreamId<X> sourceStreamId, java.time.Duration duration)
Deprecated.Creates aStreamIdthat will be used to create aPublisherwhich will re-emit all the items emitted by thePublishers identified by the providedStreamIdwith the specified delay.- Parameters:
sourceStreamId-StreamIdwhich identifies thePublisherthat will be used as the source of the emitted objects.duration-Durationthat will be used as the delay before re-emitting.- Returns:
- A
StreamId. - Throws:
java.lang.NullPointerException- If the provided source stream id or duration are null.- See Also:
DelayCompositionFunction
-
zippedStream
public static final <X,T> StreamId<T> zippedStream(StreamId<X> sourceStreamId1, StreamId<X> sourceStreamId2, java.util.function.BiFunction<X,X,java.util.Optional<T>> zip)
Deprecated.EXPERIMENTAL Creates aStreamIdthat will identify aPublisherwhich will emit items generated using the provided method and the values emitted by thePublishers identified by the providedStreamIds. The zip function always returns anOptional, if the value is present then it will be emitted, otherwise nothing will be emitted.- Parameters:
sourceStreamId1-StreamIdwhich identifies thePublisherthat will be used as the source of the objects used by the zip function.sourceStreamId2-StreamIdwhich identifies thePublisherthat will be used as the source of the objects used by the zip function.zip- ABiFunctionwhich will merge both objects into a single new instance of type T.- Returns:
- A
StreamId. - Throws:
java.lang.NullPointerException- If any of the provided source stream ids or zip function are null.- See Also:
ZipCompositionFunction
-
-