public static class TestCompletable.Builder
extends java.lang.Object
TestCompletable
s with non-default settings. For defaults, see Defaults section
of class javadoc.Constructor and Description |
---|
Builder() |
public TestCompletable.Builder concurrentSubscribers()
ConcurrentCompletableSubscriberFunction
public TestCompletable.Builder concurrentSubscribers(ConcurrentCompletableSubscriberFunction function)
ConcurrentCompletableSubscriberFunction
.
Default is to allow only sequential subscribers.function
- the ConcurrentCompletableSubscriberFunction
to use.public TestCompletable.Builder sequentialSubscribers()
SequentialCompletableSubscriberFunction
public TestCompletable.Builder sequentialSubscribers(SequentialCompletableSubscriberFunction function)
SequentialCompletableSubscriberFunction
.
This is the default.function
- the SequentialCompletableSubscriberFunction
to use.public TestCompletable.Builder singleSubscriber()
NonResubscribeableCompletableSubscriberFunction
public TestCompletable.Builder singleSubscriber(NonResubscribeableCompletableSubscriberFunction function)
NonResubscribeableCompletableSubscriberFunction
.
Default is to allow sequential subscribers.function
- the NonResubscribeableCompletableSubscriberFunction
to use.public TestCompletable.Builder autoOnSubscribe()
Subscriber#onSubscribe(Cancellable)
automatically upon subscribe. The default is
enabled.AutoOnSubscribeCompletableSubscriberFunction
public TestCompletable.Builder autoOnSubscribe(AutoOnSubscribeCompletableSubscriberFunction function)
Subscriber#onSubscribe(Cancellable)
automatically upon subscribe, with the specified
AutoOnSubscribeCompletableSubscriberFunction
. The default is enabled.function
- the AutoOnSubscribeCompletableSubscriberFunction
to use.public TestCompletable.Builder disableAutoOnSubscribe()
Subscriber#onSubscribe(Cancellable)
automatically upon subscribe. The default is
enabled.public TestCompletable build(java.util.function.Function<CompletableSource.Subscriber,CompletableSource.Subscriber> function)
TestCompletable
using the specified subscriber function.
All other settings from this TestCompletable.Builder
will be ignored.
function
- The subscriber function to use.TestCompletable
.public TestCompletable build()
TestCompletable
as configured by the builder.TestCompletable
.