signature:
public class ParallelFlowable { /** * Reduces all values within a ' rail ' to a single value ( with a possibly different type ) via
 * a reducer function that is initialized on each rail from an initialSupplier value .
 * Note that the same mapper function may be called from multiple threads concurrently .
 * @ param < R > the reduced output type
 * @ param initialSupplier the supplier for the initial value
 * @ param reducer the function to reduce a previous output of reduce ( or the initial value supplied )
 * with a current source value .
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > reduce ( @ NonNull Callable < R > initialSupplier , @ NonNull BiFunction < R , ? super T , R > reducer ) { } }

implementation: ObjectHelper . requireNonNull ( initialSupplier , "initialSupplier" ) ; ObjectHelper . requireNonNull ( reducer , "reducer" ) ; return RxJavaPlugins . onAssembly ( new ParallelReduce < T , R > ( this , initialSupplier , reducer ) ) ;


signature:
public class ParallelFlowable { /** * Merges the values from each ' rail ' in a round - robin or same - order fashion and
 * exposes it as a regular Publisher sequence , running with a default prefetch value
 * for the rails .
 * This operator uses the default prefetch size returned by { @ code Flowable . bufferSize ( ) } .
 * < img width = " 640 " height = " 602 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / parallelflowable . sequential . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequential } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Flowable instance
 * @ see ParallelFlowable # sequential ( int )
 * @ see ParallelFlowable # sequentialDelayError ( ) */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue public final Flowable < T > sequential ( ) { } }

implementation: return sequential ( Flowable . bufferSize ( ) ) ;


signature:
public class ParallelFlowable { /** * Merges the values from each ' rail ' in a round - robin or same - order fashion and
 * exposes it as a regular Publisher sequence , running with a give prefetch value
 * for the rails .
 * < img width = " 640 " height = " 602 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / parallelflowable . sequential . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequential } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param prefetch the prefetch amount to use for each rail
 * @ return the new Flowable instance
 * @ see ParallelFlowable # sequential ( )
 * @ see ParallelFlowable # sequentialDelayError ( int ) */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue @ NonNull public final Flowable < T > sequential ( int prefetch ) { } }

implementation: ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ParallelJoin < T > ( this , prefetch , false ) ) ;


signature:
public class ParallelFlowable { /** * Merges the values from each ' rail ' in a round - robin or same - order fashion and
 * exposes it as a regular Flowable sequence , running with a default prefetch value
 * for the rails and delaying errors from all rails till all terminate .
 * This operator uses the default prefetch size returned by { @ code Flowable . bufferSize ( ) } .
 * < img width = " 640 " height = " 602 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / parallelflowable . sequential . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequentialDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.0.7 - experimental
 * @ return the new Flowable instance
 * @ see ParallelFlowable # sequentialDelayError ( int )
 * @ see ParallelFlowable # sequential ( )
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue @ NonNull public final Flowable < T > sequentialDelayError ( ) { } }

implementation: return sequentialDelayError ( Flowable . bufferSize ( ) ) ;


signature:
public class ParallelFlowable { /** * Merges the values from each ' rail ' in a round - robin or same - order fashion and
 * exposes it as a regular Publisher sequence , running with a give prefetch value
 * for the rails and delaying errors from all rails till all terminate .
 * < img width = " 640 " height = " 602 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / parallelflowable . sequential . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequentialDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.0.7 - experimental
 * @ param prefetch the prefetch amount to use for each rail
 * @ return the new Flowable instance
 * @ see ParallelFlowable # sequential ( )
 * @ see ParallelFlowable # sequentialDelayError ( )
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue @ NonNull public final Flowable < T > sequentialDelayError ( int prefetch ) { } }

implementation: ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ParallelJoin < T > ( this , prefetch , true ) ) ;


signature:
public class ParallelFlowable { /** * Sorts the ' rails ' of this ParallelFlowable and returns a Publisher that sequentially
 * picks the smallest next value from the rails .
 * This operator requires a finite source ParallelFlowable .
 * @ param comparator the comparator to use
 * @ return the new Flowable instance */
@ CheckReturnValue @ NonNull public final Flowable < T > sorted ( @ NonNull Comparator < ? super T > comparator ) { } }

implementation: return sorted ( comparator , 16 ) ;


signature:
public class ParallelFlowable { /** * Sorts the ' rails ' according to the comparator and returns a full sorted list as a Publisher .
 * This operator requires a finite source ParallelFlowable .
 * @ param comparator the comparator to compare elements
 * @ return the new Flowable instance */
@ CheckReturnValue @ NonNull public final Flowable < List < T > > toSortedList ( @ NonNull Comparator < ? super T > comparator ) { } }

implementation: return toSortedList ( comparator , 16 ) ;


signature:
public class ParallelFlowable { /** * Sorts the ' rails ' according to the comparator and returns a full sorted list as a Publisher .
 * This operator requires a finite source ParallelFlowable .
 * @ param comparator the comparator to compare elements
 * @ param capacityHint the expected number of total elements
 * @ return the new Flowable instance */
@ CheckReturnValue @ NonNull public final Flowable < List < T > > toSortedList ( @ NonNull Comparator < ? super T > comparator , int capacityHint ) { } }

implementation: ObjectHelper . requireNonNull ( comparator , "comparator is null" ) ; ObjectHelper . verifyPositive ( capacityHint , "capacityHint" ) ; int ch = capacityHint / parallelism ( ) + 1 ; ParallelFlowable < List < T > > railReduced = reduce ( Functions . < T > createArrayList ( ch ) , ListAddBiConsumer . < T > instance ( ) ) ; ParallelFlowable < List < T > > railSorted = railReduced . map ( new SorterFunction < T > ( comparator ) ) ; Flowable < List < T > > merged = railSorted . reduce ( new MergerBiFunction < T > ( comparator ) ) ; return RxJavaPlugins . onAssembly ( merged ) ;


signature:
public class ParallelFlowable { /** * Call the specified consumer with the current element passing through any ' rail ' .
 * @ param onNext the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnNext ( @ NonNull Consumer < ? super T > onNext ) { } }

implementation: ObjectHelper . requireNonNull ( onNext , "onNext is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , onNext , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Call the specified consumer with the current element passing through any ' rail ' and
 * handles errors based on the given { @ link ParallelFailureHandling } enumeration value .
 * < p > History : 2.0.8 - experimental
 * @ param onNext the callback
 * @ param errorHandler the enumeration that defines how to handle errors thrown
 * from the onNext consumer
 * @ return the new ParallelFlowable instance
 * @ since 2.2 */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnNext ( @ NonNull Consumer < ? super T > onNext , @ NonNull ParallelFailureHandling errorHandler ) { } }

implementation: ObjectHelper . requireNonNull ( onNext , "onNext is null" ) ; ObjectHelper . requireNonNull ( errorHandler , "errorHandler is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelDoOnNextTry < T > ( this , onNext , errorHandler ) ) ;


signature:
public class ParallelFlowable { /** * Call the specified consumer with the current element passing through any ' rail '
 * after it has been delivered to downstream within the rail .
 * @ param onAfterNext the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doAfterNext ( @ NonNull Consumer < ? super T > onAfterNext ) { } }

implementation: ObjectHelper . requireNonNull ( onAfterNext , "onAfterNext is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , onAfterNext , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Call the specified consumer with the exception passing through any ' rail ' .
 * @ param onError the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnError ( @ NonNull Consumer < Throwable > onError ) { } }

implementation: ObjectHelper . requireNonNull ( onError , "onError is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , onError , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Run the specified Action when a ' rail ' completes .
 * @ param onComplete the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnComplete ( @ NonNull Action onComplete ) { } }

implementation: ObjectHelper . requireNonNull ( onComplete , "onComplete is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , onComplete , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Run the specified Action when a ' rail ' completes or signals an error .
 * @ param onAfterTerminate the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doAfterTerminated ( @ NonNull Action onAfterTerminate ) { } }

implementation: ObjectHelper . requireNonNull ( onAfterTerminate , "onAfterTerminate is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , onAfterTerminate , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Call the specified callback when a ' rail ' receives a Subscription from its upstream .
 * @ param onSubscribe the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnSubscribe ( @ NonNull Consumer < ? super Subscription > onSubscribe ) { } }

implementation: ObjectHelper . requireNonNull ( onSubscribe , "onSubscribe is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , onSubscribe , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Call the specified consumer with the request amount if any rail receives a request .
 * @ param onRequest the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnRequest ( @ NonNull LongConsumer onRequest ) { } }

implementation: ObjectHelper . requireNonNull ( onRequest , "onRequest is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , onRequest , Functions . EMPTY_ACTION ) ) ;


signature:
public class ParallelFlowable { /** * Run the specified Action when a ' rail ' receives a cancellation .
 * @ param onCancel the callback
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final ParallelFlowable < T > doOnCancel ( @ NonNull Action onCancel ) { } }

implementation: ObjectHelper . requireNonNull ( onCancel , "onCancel is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelPeek < T > ( this , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION , Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , onCancel ) ) ;


signature:
public class ParallelFlowable { /** * Collect the elements in each rail into a collection supplied via a collectionSupplier
 * and collected into with a collector action , emitting the collection at the end .
 * @ param < C > the collection type
 * @ param collectionSupplier the supplier of the collection in each rail
 * @ param collector the collector , taking the per - rail collection and the current item
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < C > ParallelFlowable < C > collect ( @ NonNull Callable < ? extends C > collectionSupplier , @ NonNull BiConsumer < ? super C , ? super T > collector ) { } }

implementation: ObjectHelper . requireNonNull ( collectionSupplier , "collectionSupplier is null" ) ; ObjectHelper . requireNonNull ( collector , "collector is null" ) ; return RxJavaPlugins . onAssembly ( new ParallelCollect < T , C > ( this , collectionSupplier , collector ) ) ;


signature:
public class ParallelFlowable { /** * Wraps multiple Publishers into a ParallelFlowable which runs them
 * in parallel and unordered .
 * @ param < T > the value type
 * @ param publishers the array of publishers
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public static < T > ParallelFlowable < T > fromArray ( @ NonNull Publisher < T > ... publishers ) { } }

implementation: if ( publishers . length == 0 ) { throw new IllegalArgumentException ( "Zero publishers not supported" ) ; } return RxJavaPlugins . onAssembly ( new ParallelFromArray < T > ( publishers ) ) ;


signature:
public class ParallelFlowable { /** * Perform a fluent transformation to a value via a converter function which
 * receives this ParallelFlowable .
 * @ param < U > the output value type
 * @ param converter the converter function from ParallelFlowable to some type
 * @ return the value returned by the converter function */
@ CheckReturnValue @ NonNull public final < U > U to ( @ NonNull Function < ? super ParallelFlowable < T > , U > converter ) { } }

implementation: try { return ObjectHelper . requireNonNull ( converter , "converter is null" ) . apply ( this ) ; } catch ( Throwable ex ) { Exceptions . throwIfFatal ( ex ) ; throw ExceptionHelper . wrapOrThrow ( ex ) ; }


signature:
public class ParallelFlowable { /** * Allows composing operators , in assembly time , on top of this ParallelFlowable
 * and returns another ParallelFlowable with composed features .
 * @ param < U > the output value type
 * @ param composer the composer function from ParallelFlowable ( this ) to another ParallelFlowable
 * @ return the ParallelFlowable returned by the function */
@ CheckReturnValue @ NonNull public final < U > ParallelFlowable < U > compose ( @ NonNull ParallelTransformer < T , U > composer ) { } }

implementation: return RxJavaPlugins . onAssembly ( ObjectHelper . requireNonNull ( composer , "composer is null" ) . apply ( this ) ) ;


signature:
public class ParallelFlowable { /** * Generates and flattens Publishers on each ' rail ' , optionally delaying errors .
 * It uses unbounded concurrency along with default inner prefetch .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * @ param delayError should the errors from the main and the inner sources delayed till everybody terminates ?
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > flatMap ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper , boolean delayError ) { } }

implementation: return flatMap ( mapper , delayError , Integer . MAX_VALUE , Flowable . bufferSize ( ) ) ;


signature:
public class ParallelFlowable { /** * Generates and flattens Publishers on each ' rail ' , optionally delaying errors ,
 * having a total number of simultaneous subscriptions to the inner Publishers
 * and using the given prefetch amount for the inner Publishers .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * @ param delayError should the errors from the main and the inner sources delayed till everybody terminates ?
 * @ param maxConcurrency the maximum number of simultaneous subscriptions to the generated inner Publishers
 * @ param prefetch the number of items to prefetch from each inner Publisher
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > flatMap ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper , boolean delayError , int maxConcurrency , int prefetch ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( maxConcurrency , "maxConcurrency" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ParallelFlatMap < T , R > ( this , mapper , delayError , maxConcurrency , prefetch ) ) ;


signature:
public class ParallelFlowable { /** * Generates and concatenates Publishers on each ' rail ' , signalling errors immediately
 * and generating 2 publishers upfront .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * source and the inner Publishers ( immediate , boundary , end )
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > concatMap ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper ) { } }

implementation: return concatMap ( mapper , 2 ) ;


signature:
public class ParallelFlowable { /** * Generates and concatenates Publishers on each ' rail ' , signalling errors immediately
 * and using the given prefetch amount for generating Publishers upfront .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * @ param prefetch the number of items to prefetch from each inner Publisher
 * source and the inner Publishers ( immediate , boundary , end )
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > concatMap ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper , int prefetch ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ParallelConcatMap < T , R > ( this , mapper , prefetch , ErrorMode . IMMEDIATE ) ) ;


signature:
public class ParallelFlowable { /** * Generates and concatenates Publishers on each ' rail ' , optionally delaying errors
 * and generating 2 publishers upfront .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * @ param tillTheEnd if true all errors from the upstream and inner Publishers are delayed
 * till all of them terminate , if false , the error is emitted when an inner Publisher terminates .
 * source and the inner Publishers ( immediate , boundary , end )
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > concatMapDelayError ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper , boolean tillTheEnd ) { } }

implementation: return concatMapDelayError ( mapper , 2 , tillTheEnd ) ;


signature:
public class ParallelFlowable { /** * Generates and concatenates Publishers on each ' rail ' , optionally delaying errors
 * and using the given prefetch amount for generating Publishers upfront .
 * @ param < R > the result type
 * @ param mapper the function to map each rail ' s value into a Publisher
 * @ param prefetch the number of items to prefetch from each inner Publisher
 * @ param tillTheEnd if true all errors from the upstream and inner Publishers are delayed
 * till all of them terminate , if false , the error is emitted when an inner Publisher terminates .
 * @ return the new ParallelFlowable instance */
@ CheckReturnValue @ NonNull public final < R > ParallelFlowable < R > concatMapDelayError ( @ NonNull Function < ? super T , ? extends Publisher < ? extends R > > mapper , int prefetch , boolean tillTheEnd ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ParallelConcatMap < T , R > ( this , mapper , prefetch , tillTheEnd ? ErrorMode . END : ErrorMode . BOUNDARY ) ) ;


signature:
public class ObservableReplay { /** * Given a connectable observable factory , it multicasts over the generated
 * ConnectableObservable via a selector function .
 * @ param < U > the value type of the ConnectableObservable
 * @ param < R > the result value type
 * @ param connectableFactory the factory that returns a ConnectableObservable for each individual subscriber
 * @ param selector the function that receives an Observable and should return another Observable that will be subscribed to
 * @ return the new Observable instance */
public static < U , R > Observable < R > multicastSelector ( final Callable < ? extends ConnectableObservable < U > > connectableFactory , final Function < ? super Observable < U > , ? extends ObservableSource < R > > selector ) { } }

implementation: return RxJavaPlugins . onAssembly ( new MulticastReplay < R , U > ( connectableFactory , selector ) ) ;


signature:
public class ObservableReplay { /** * Child Observers will observe the events of the ConnectableObservable on the
 * specified scheduler .
 * @ param < T > the value type
 * @ param co the connectable observable instance
 * @ param scheduler the target scheduler
 * @ return the new ConnectableObservable instance */
public static < T > ConnectableObservable < T > observeOn ( final ConnectableObservable < T > co , final Scheduler scheduler ) { } }

implementation: final Observable < T > observable = co . observeOn ( scheduler ) ; return RxJavaPlugins . onAssembly ( new Replay < T > ( co , observable ) ) ;


signature:
public class ObservableReplay { /** * Creates a replaying ConnectableObservable with an unbounded buffer .
 * @ param < T > the value type
 * @ param source the source observable
 * @ return the new ConnectableObservable instance */
@ SuppressWarnings ( "unchecked" ) public static < T > ConnectableObservable < T > createFrom ( ObservableSource < ? extends T > source ) { } }

implementation: return create ( source , DEFAULT_UNBOUNDED_FACTORY ) ;


signature:
public class ObservableReplay { /** * Creates a replaying ConnectableObservable with a size bound buffer .
 * @ param < T > the value type
 * @ param source the source ObservableSource to use
 * @ param bufferSize the maximum number of elements to hold
 * @ return the new ConnectableObservable instance */
public static < T > ConnectableObservable < T > create ( ObservableSource < T > source , final int bufferSize ) { } }

implementation: if ( bufferSize == Integer . MAX_VALUE ) { return createFrom ( source ) ; } return create ( source , new ReplayBufferSupplier < T > ( bufferSize ) ) ;


signature:
public class ObservableReplay { /** * Creates a replaying ConnectableObservable with a time bound buffer .
 * @ param < T > the value type
 * @ param source the source ObservableSource to use
 * @ param maxAge the maximum age of entries
 * @ param unit the unit of measure of the age amount
 * @ param scheduler the target scheduler providing the current time
 * @ return the new ConnectableObservable instance */
public static < T > ConnectableObservable < T > create ( ObservableSource < T > source , long maxAge , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return create ( source , maxAge , unit , scheduler , Integer . MAX_VALUE ) ;


signature:
public class ObservableReplay { /** * Creates a replaying ConnectableObservable with a size and time bound buffer .
 * @ param < T > the value type
 * @ param source the source ObservableSource to use
 * @ param maxAge the maximum age of entries
 * @ param unit the unit of measure of the age amount
 * @ param scheduler the target scheduler providing the current time
 * @ param bufferSize the maximum number of elements to hold
 * @ return the new ConnectableObservable instance */
public static < T > ConnectableObservable < T > create ( ObservableSource < T > source , final long maxAge , final TimeUnit unit , final Scheduler scheduler , final int bufferSize ) { } }

implementation: return create ( source , new ScheduledReplaySupplier < T > ( bufferSize , maxAge , unit , scheduler ) ) ;


signature:
public class ObservableReplay { /** * Creates a OperatorReplay instance to replay values of the given source observable .
 * @ param source the source observable
 * @ param bufferFactory the factory to instantiate the appropriate buffer when the observable becomes active
 * @ return the connectable observable */
static < T > ConnectableObservable < T > create ( ObservableSource < T > source , final BufferSupplier < T > bufferFactory ) { } }

implementation:
// the current connection to source needs to be shared between the operator and its onSubscribe call
final AtomicReference < ReplayObserver < T > > curr = new AtomicReference < ReplayObserver < T > > ( ) ; ObservableSource < T > onSubscribe = new ReplaySource < T > ( curr , bufferFactory ) ; return RxJavaPlugins . onAssembly ( new ObservableReplay < T > ( onSubscribe , source , curr , bufferFactory ) ) ;


signature:
public class ArrayCompositeSubscription { /** * Sets the resource at the specified index and disposes the old resource .
 * @ param index the index of the resource to set
 * @ param resource the new resource
 * @ return true if the resource has ben set , false if the composite has been disposed */
public boolean setResource ( int index , Subscription resource ) { } }

implementation: for ( ; ; ) { Subscription o = get ( index ) ; if ( o == SubscriptionHelper . CANCELLED ) { if ( resource != null ) { resource . cancel ( ) ; } return false ; } if ( compareAndSet ( index , o , resource ) ) { if ( o != null ) { o . cancel ( ) ; } return true ; } }


signature:
public class ArrayCompositeSubscription { /** * Replaces the resource at the specified index and returns the old resource .
 * @ param index the index of the resource to replace
 * @ param resource the new resource
 * @ return the old resource , can be null */
public Subscription replaceResource ( int index , Subscription resource ) { } }

implementation: for ( ; ; ) { Subscription o = get ( index ) ; if ( o == SubscriptionHelper . CANCELLED ) { if ( resource != null ) { resource . cancel ( ) ; } return null ; } if ( compareAndSet ( index , o , resource ) ) { return o ; } }


signature:
public class UnicastProcessor { /** * Creates an UnicastProcessor with the given internal buffer capacity hint .
 * @ param < T > the value type
 * @ param capacityHint the hint to size the internal unbounded buffer
 * @ return an UnicastProcessor instance */
@ CheckReturnValue @ NonNull public static < T > UnicastProcessor < T > create ( int capacityHint ) { } }

implementation: return new UnicastProcessor < T > ( capacityHint ) ;


signature:
public class UnicastProcessor { /** * Creates an UnicastProcessor with default internal buffer capacity hint and delay error flag .
 * < p > History : 2.0.8 - experimental
 * @ param < T > the value type
 * @ param delayError deliver pending onNext events before onError
 * @ return an UnicastProcessor instance
 * @ since 2.2 */
@ CheckReturnValue @ NonNull public static < T > UnicastProcessor < T > create ( boolean delayError ) { } }

implementation: return new UnicastProcessor < T > ( bufferSize ( ) , null , delayError ) ;


signature:
public class UnicastProcessor { /** * Creates an UnicastProcessor with the given internal buffer capacity hint and a callback for
 * the case when the single Subscriber cancels its subscription .
 * < p > The callback , if not null , is called exactly once and
 * non - overlapped with any active replay .
 * @ param < T > the value type
 * @ param capacityHint the hint to size the internal unbounded buffer
 * @ param onCancelled the non null callback
 * @ return an UnicastProcessor instance */
@ CheckReturnValue @ NonNull public static < T > UnicastProcessor < T > create ( int capacityHint , Runnable onCancelled ) { } }

implementation: ObjectHelper . requireNonNull ( onCancelled , "onTerminate" ) ; return new UnicastProcessor < T > ( capacityHint , onCancelled ) ;


signature:
public class FlowableScalarXMap { /** * Tries to subscribe to a possibly Callable source ' s mapped Publisher .
 * @ param < T > the input value type
 * @ param < R > the output value type
 * @ param source the source Publisher
 * @ param subscriber the subscriber
 * @ param mapper the function mapping a scalar value into a Publisher
 * @ return true if successful , false if the caller should continue with the regular path . */
@ SuppressWarnings ( "unchecked" ) public static < T , R > boolean tryScalarXMapSubscribe ( Publisher < T > source , Subscriber < ? super R > subscriber , Function < ? super T , ? extends Publisher < ? extends R > > mapper ) { } }

implementation: if ( source instanceof Callable ) { T t ; try { t = ( ( Callable < T > ) source ) . call ( ) ; } catch ( Throwable ex ) { Exceptions . throwIfFatal ( ex ) ; EmptySubscription . error ( ex , subscriber ) ; return true ; } if ( t == null ) { EmptySubscription . complete ( subscriber ) ; return true ; } Publisher < ? extends R > r ; try { r = ObjectHelper . requireNonNull ( mapper . apply ( t ) , "The mapper returned a null Publisher" ) ; } catch ( Throwable ex ) { Exceptions . throwIfFatal ( ex ) ; EmptySubscription . error ( ex , subscriber ) ; return true ; } if ( r instanceof Callable ) { R u ; try { u = ( ( Callable < R > ) r ) . call ( ) ; } catch ( Throwable ex ) { Exceptions . throwIfFatal ( ex ) ; EmptySubscription . error ( ex , subscriber ) ; return true ; } if ( u == null ) { EmptySubscription . complete ( subscriber ) ; return true ; } subscriber . onSubscribe ( new ScalarSubscription < R > ( subscriber , u ) ) ; } else { r . subscribe ( subscriber ) ; } return true ; } return false ;


signature:
public class FlowableScalarXMap { /** * Maps a scalar value into a Publisher and emits its values .
 * @ param < T > the scalar value type
 * @ param < U > the output value type
 * @ param value the scalar value to map
 * @ param mapper the function that gets the scalar value and should return
 * a Publisher that gets streamed
 * @ return the new Flowable instance */
public static < T , U > Flowable < U > scalarXMap ( final T value , final Function < ? super T , ? extends Publisher < ? extends U > > mapper ) { } }

implementation: return RxJavaPlugins . onAssembly ( new ScalarXMapFlowable < T , U > ( value , mapper ) ) ;


signature:
public class Disposables { /** * Construct a Disposable by wrapping a Runnable that is
 * executed exactly once when the Disposable is disposed .
 * @ param run the Runnable to wrap
 * @ return the new Disposable instance */
@ NonNull public static Disposable fromRunnable ( @ NonNull Runnable run ) { } }

implementation: ObjectHelper . requireNonNull ( run , "run is null" ) ; return new RunnableDisposable ( run ) ;


signature:
public class Disposables { /** * Construct a Disposable by wrapping a Action that is
 * executed exactly once when the Disposable is disposed .
 * @ param run the Action to wrap
 * @ return the new Disposable instance */
@ NonNull public static Disposable fromAction ( @ NonNull Action run ) { } }

implementation: ObjectHelper . requireNonNull ( run , "run is null" ) ; return new ActionDisposable ( run ) ;


signature:
public class Disposables { /** * Construct a Disposable by wrapping a Future that is
 * cancelled exactly once when the Disposable is disposed .
 * @ param future the Future to wrap
 * @ return the new Disposable instance */
@ NonNull public static Disposable fromFuture ( @ NonNull Future < ? > future ) { } }

implementation: ObjectHelper . requireNonNull ( future , "future is null" ) ; return fromFuture ( future , true ) ;


signature:
public class Disposables { /** * Construct a Disposable by wrapping a Future that is
 * cancelled exactly once when the Disposable is disposed .
 * @ param future the Future to wrap
 * @ param allowInterrupt if true , the future cancel happens via Future . cancel ( true )
 * @ return the new Disposable instance */
@ NonNull public static Disposable fromFuture ( @ NonNull Future < ? > future , boolean allowInterrupt ) { } }

implementation: ObjectHelper . requireNonNull ( future , "future is null" ) ; return new FutureDisposable ( future , allowInterrupt ) ;


signature:
public class Disposables { /** * Construct a Disposable by wrapping a Subscription that is
 * cancelled exactly once when the Disposable is disposed .
 * @ param subscription the Runnable to wrap
 * @ return the new Disposable instance */
@ NonNull public static Disposable fromSubscription ( @ NonNull Subscription subscription ) { } }

implementation: ObjectHelper . requireNonNull ( subscription , "subscription is null" ) ; return new SubscriptionDisposable ( subscription ) ;


signature:
public class BlockingBaseObserver { /** * Block until the first value arrives and return it , otherwise
 * return null for an empty source and rethrow any exception .
 * @ return the first value or null if the source is empty */
public final T blockingGet ( ) { } }

implementation: if ( getCount ( ) != 0 ) { try { BlockingHelper . verifyNonBlocking ( ) ; await ( ) ; } catch ( InterruptedException ex ) { dispose ( ) ; throw ExceptionHelper . wrapOrThrow ( ex ) ; } } Throwable e = error ; if ( e != null ) { throw ExceptionHelper . wrapOrThrow ( e ) ; } return value ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler a { @ link Callable } which returns the hook ' s input value
 * @ return the value returned by the hook , not null
 * @ throws NullPointerException if the callable parameter or its result are null */
@ NonNull public static Scheduler initComputationScheduler ( @ NonNull Callable < Scheduler > defaultScheduler ) { } }

implementation: ObjectHelper . requireNonNull ( defaultScheduler , "Scheduler Callable can't be null" ) ; Function < ? super Callable < Scheduler > , ? extends Scheduler > f = onInitComputationHandler ; if ( f == null ) { return callRequireNonNull ( defaultScheduler ) ; } return applyRequireNonNull ( f , defaultScheduler ) ; // JIT will skip this


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler a { @ link Callable } which returns the hook ' s input value
 * @ return the value returned by the hook , not null
 * @ throws NullPointerException if the callable parameter or its result are null */
@ NonNull public static Scheduler initIoScheduler ( @ NonNull Callable < Scheduler > defaultScheduler ) { } }

implementation: ObjectHelper . requireNonNull ( defaultScheduler , "Scheduler Callable can't be null" ) ; Function < ? super Callable < Scheduler > , ? extends Scheduler > f = onInitIoHandler ; if ( f == null ) { return callRequireNonNull ( defaultScheduler ) ; } return applyRequireNonNull ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler a { @ link Callable } which returns the hook ' s input value
 * @ return the value returned by the hook , not null
 * @ throws NullPointerException if the callable parameter or its result are null */
@ NonNull public static Scheduler initNewThreadScheduler ( @ NonNull Callable < Scheduler > defaultScheduler ) { } }

implementation: ObjectHelper . requireNonNull ( defaultScheduler , "Scheduler Callable can't be null" ) ; Function < ? super Callable < Scheduler > , ? extends Scheduler > f = onInitNewThreadHandler ; if ( f == null ) { return callRequireNonNull ( defaultScheduler ) ; } return applyRequireNonNull ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler a { @ link Callable } which returns the hook ' s input value
 * @ return the value returned by the hook , not null
 * @ throws NullPointerException if the callable parameter or its result are null */
@ NonNull public static Scheduler initSingleScheduler ( @ NonNull Callable < Scheduler > defaultScheduler ) { } }

implementation: ObjectHelper . requireNonNull ( defaultScheduler , "Scheduler Callable can't be null" ) ; Function < ? super Callable < Scheduler > , ? extends Scheduler > f = onInitSingleHandler ; if ( f == null ) { return callRequireNonNull ( defaultScheduler ) ; } return applyRequireNonNull ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler the hook ' s input value
 * @ return the value returned by the hook */
@ NonNull public static Scheduler onComputationScheduler ( @ NonNull Scheduler defaultScheduler ) { } }

implementation: Function < ? super Scheduler , ? extends Scheduler > f = onComputationHandler ; if ( f == null ) { return defaultScheduler ; } return apply ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Called when an undeliverable error occurs .
 * Undeliverable errors are those { @ code Observer . onError ( ) } invocations that are not allowed to happen on
 * the given consumer type ( { @ code Observer } , { @ code Subscriber } , etc . ) due to protocol restrictions
 * because the consumer has either disposed / cancelled its { @ code Disposable } / { @ code Subscription } or
 * has already terminated with an { @ code onError ( ) } or { @ code onComplete ( ) } signal .
 * By default , this global error handler prints the stacktrace via { @ link Throwable # printStackTrace ( ) }
 * and calls { @ link java . lang . Thread . UncaughtExceptionHandler # uncaughtException ( Thread , Throwable ) }
 * on the current thread .
 * Note that on some platforms , the platform runtime terminates the current application with an error if such
 * uncaught exceptions happen . In this case , it is recommended the application installs a global error
 * handler via the { @ link # setErrorHandler ( Consumer ) } plugin method .
 * @ param error the error to report
 * @ see # getErrorHandler ( )
 * @ see # setErrorHandler ( Consumer )
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / What ' s - different - in - 2.0 # error - handling " > Error handling Wiki < / a > */
public static void onError ( @ NonNull Throwable error ) { } }

implementation:
Consumer < ? super Throwable > f = errorHandler ; if ( error == null ) { error = new NullPointerException ( "onError called with null. Null values are generally not allowed in 2.x operators and sources." ) ; } else { if ( ! isBug ( error ) ) { error = new UndeliverableException ( error ) ; } } if ( f != null ) { try { f . accept ( error ) ; return ; } catch ( Throwable e ) { // Exceptions . throwIfFatal ( e ) ; TODO decide
e . printStackTrace ( ) ; // NOPMD
uncaught ( e ) ; } } error . printStackTrace ( ) ; // NOPMD
uncaught ( error ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler the hook ' s input value
 * @ return the value returned by the hook */
@ NonNull public static Scheduler onIoScheduler ( @ NonNull Scheduler defaultScheduler ) { } }

implementation: Function < ? super Scheduler , ? extends Scheduler > f = onIoHandler ; if ( f == null ) { return defaultScheduler ; } return apply ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler the hook ' s input value
 * @ return the value returned by the hook */
@ NonNull public static Scheduler onNewThreadScheduler ( @ NonNull Scheduler defaultScheduler ) { } }

implementation: Function < ? super Scheduler , ? extends Scheduler > f = onNewThreadHandler ; if ( f == null ) { return defaultScheduler ; } return apply ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Called when a task is scheduled .
 * @ param run the runnable instance
 * @ return the replacement runnable */
@ NonNull public static Runnable onSchedule ( @ NonNull Runnable run ) { } }

implementation: ObjectHelper . requireNonNull ( run , "run is null" ) ; Function < ? super Runnable , ? extends Runnable > f = onScheduleHandler ; if ( f == null ) { return run ; } return apply ( f , run ) ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param defaultScheduler the hook ' s input value
 * @ return the value returned by the hook */
@ NonNull public static Scheduler onSingleScheduler ( @ NonNull Scheduler defaultScheduler ) { } }

implementation: Function < ? super Scheduler , ? extends Scheduler > f = onSingleHandler ; if ( f == null ) { return defaultScheduler ; } return apply ( f , defaultScheduler ) ;


signature:
public class RxJavaPlugins { /** * Removes all handlers and resets to default behavior . */
public static void reset ( ) { } }

implementation: setErrorHandler ( null ) ; setScheduleHandler ( null ) ; setComputationSchedulerHandler ( null ) ; setInitComputationSchedulerHandler ( null ) ; setIoSchedulerHandler ( null ) ; setInitIoSchedulerHandler ( null ) ; setSingleSchedulerHandler ( null ) ; setInitSingleSchedulerHandler ( null ) ; setNewThreadSchedulerHandler ( null ) ; setInitNewThreadSchedulerHandler ( null ) ; setOnFlowableAssembly ( null ) ; setOnFlowableSubscribe ( null ) ; setOnObservableAssembly ( null ) ; setOnObservableSubscribe ( null ) ; setOnSingleAssembly ( null ) ; setOnSingleSubscribe ( null ) ; setOnCompletableAssembly ( null ) ; setOnCompletableSubscribe ( null ) ; setOnConnectableFlowableAssembly ( null ) ; setOnConnectableObservableAssembly ( null ) ; setOnMaybeAssembly ( null ) ; setOnMaybeSubscribe ( null ) ; setOnParallelAssembly ( null ) ; setFailOnNonBlockingScheduler ( false ) ; setOnBeforeBlocking ( null ) ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed */
public static void setComputationSchedulerHandler ( @ Nullable Function < ? super Scheduler , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onComputationHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed , but the function may not return null */
public static void setInitComputationSchedulerHandler ( @ Nullable Function < ? super Callable < Scheduler > , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onInitComputationHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed , but the function may not return null */
public static void setInitIoSchedulerHandler ( @ Nullable Function < ? super Callable < Scheduler > , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onInitIoHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed , but the function may not return null */
public static void setInitNewThreadSchedulerHandler ( @ Nullable Function < ? super Callable < Scheduler > , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onInitNewThreadHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed , but the function may not return null */
public static void setInitSingleSchedulerHandler ( @ Nullable Function < ? super Callable < Scheduler > , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onInitSingleHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed */
public static void setIoSchedulerHandler ( @ Nullable Function < ? super Scheduler , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onIoHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed */
public static void setNewThreadSchedulerHandler ( @ Nullable Function < ? super Scheduler , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onNewThreadHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed */
public static void setScheduleHandler ( @ Nullable Function < ? super Runnable , ? extends Runnable > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onScheduleHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param handler the hook function to set , null allowed */
public static void setSingleSchedulerHandler ( @ Nullable Function < ? super Scheduler , ? extends Scheduler > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onSingleHandler = handler ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onCompletableAssembly the hook function to set , null allowed */
public static void setOnCompletableAssembly ( @ Nullable Function < ? super Completable , ? extends Completable > onCompletableAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onCompletableAssembly = onCompletableAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onCompletableSubscribe the hook function to set , null allowed */
public static void setOnCompletableSubscribe ( @ Nullable BiFunction < ? super Completable , ? super CompletableObserver , ? extends CompletableObserver > onCompletableSubscribe ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onCompletableSubscribe = onCompletableSubscribe ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onFlowableAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnFlowableAssembly ( @ Nullable Function < ? super Flowable , ? extends Flowable > onFlowableAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onFlowableAssembly = onFlowableAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onMaybeAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnMaybeAssembly ( @ Nullable Function < ? super Maybe , ? extends Maybe > onMaybeAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onMaybeAssembly = onMaybeAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onConnectableFlowableAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnConnectableFlowableAssembly ( @ Nullable Function < ? super ConnectableFlowable , ? extends ConnectableFlowable > onConnectableFlowableAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onConnectableFlowableAssembly = onConnectableFlowableAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onFlowableSubscribe the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnFlowableSubscribe ( @ Nullable BiFunction < ? super Flowable , ? super Subscriber , ? extends Subscriber > onFlowableSubscribe ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onFlowableSubscribe = onFlowableSubscribe ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onMaybeSubscribe the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnMaybeSubscribe ( @ Nullable BiFunction < ? super Maybe , MaybeObserver , ? extends MaybeObserver > onMaybeSubscribe ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onMaybeSubscribe = onMaybeSubscribe ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onObservableAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnObservableAssembly ( @ Nullable Function < ? super Observable , ? extends Observable > onObservableAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onObservableAssembly = onObservableAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onConnectableObservableAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnConnectableObservableAssembly ( @ Nullable Function < ? super ConnectableObservable , ? extends ConnectableObservable > onConnectableObservableAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onConnectableObservableAssembly = onConnectableObservableAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onObservableSubscribe the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnObservableSubscribe ( @ Nullable BiFunction < ? super Observable , ? super Observer , ? extends Observer > onObservableSubscribe ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onObservableSubscribe = onObservableSubscribe ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onSingleAssembly the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnSingleAssembly ( @ Nullable Function < ? super Single , ? extends Single > onSingleAssembly ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onSingleAssembly = onSingleAssembly ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * @ param onSingleSubscribe the hook function to set , null allowed */
@ SuppressWarnings ( "rawtypes" ) public static void setOnSingleSubscribe ( @ Nullable BiFunction < ? super Single , ? super SingleObserver , ? extends SingleObserver > onSingleSubscribe ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } RxJavaPlugins . onSingleSubscribe = onSingleSubscribe ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param < T > the value type
 * @ param source the hook ' s input value
 * @ param subscriber the subscriber
 * @ return the value returned by the hook */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Subscriber < ? super T > onSubscribe ( @ NonNull Flowable < T > source , @ NonNull Subscriber < ? super T > subscriber ) { BiFunction < ? super Flowable , ? super Subscriber , ? extends Subscriber > f = onFlowableSubscribe ; if ( f != null ) { return apply ( f , source , subscriber ) ; } return subscriber ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param < T > the value type
 * @ param source the hook ' s input value
 * @ param observer the observer
 * @ return the value returned by the hook */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Observer < ? super T > onSubscribe ( @ NonNull Observable < T > source , @ NonNull Observer < ? super T > observer ) { BiFunction < ? super Observable , ? super Observer , ? extends Observer > f = onObservableSubscribe ; if ( f != null ) { return apply ( f , source , observer ) ; } return observer ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > SingleObserver < ? super T > onSubscribe ( @ NonNull Single < T > source , @ NonNull SingleObserver < ? super T > observer ) { BiFunction < ? super Single , ? super SingleObserver , ? extends SingleObserver > f = onSingleSubscribe ; if ( f != null ) { return apply ( f , source , observer ) ; } return observer ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param source the hook ' s input value
 * @ param observer the observer
 * @ return the value returned by the hook */
@ NonNull public static CompletableObserver onSubscribe ( @ NonNull Completable source , @ NonNull CompletableObserver observer ) { } }

implementation: BiFunction < ? super Completable , ? super CompletableObserver , ? extends CompletableObserver > f = onCompletableSubscribe ; if ( f != null ) { return apply ( f , source , observer ) ; } return observer ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param < T > the value type
 * @ param source the hook ' s input value
 * @ param observer the subscriber
 * @ return the value returned by the hook */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > MaybeObserver < ? super T > onSubscribe ( @ NonNull Maybe < T > source , @ NonNull MaybeObserver < ? super T > observer ) { BiFunction < ? super Maybe , ? super MaybeObserver , ? extends MaybeObserver > f = onMaybeSubscribe ; if ( f != null ) { return apply ( f , source , observer ) ; } return observer ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param < T > the value type
 * @ param source the hook ' s input value
 * @ return the value returned by the hook */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Maybe < T > onAssembly ( @ NonNull Maybe < T > source ) { Function < ? super Maybe , ? extends Maybe > f = onMaybeAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Flowable < T > onAssembly ( @ NonNull Flowable < T > source ) { Function < ? super Flowable , ? extends Flowable > f = onFlowableAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > ConnectableFlowable < T > onAssembly ( @ NonNull ConnectableFlowable < T > source ) { Function < ? super ConnectableFlowable , ? extends ConnectableFlowable > f = onConnectableFlowableAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Observable < T > onAssembly ( @ NonNull Observable < T > source ) { Function < ? super Observable , ? extends Observable > f = onObservableAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > ConnectableObservable < T > onAssembly ( @ NonNull ConnectableObservable < T > source ) { Function < ? super ConnectableObservable , ? extends ConnectableObservable > f = onConnectableObservableAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > Single < T > onAssembly ( @ NonNull Single < T > source ) { Function < ? super Single , ? extends Single > f = onSingleAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * @ param source the hook ' s input value
 * @ return the value returned by the hook */
@ NonNull public static Completable onAssembly ( @ NonNull Completable source ) { } }

implementation: Function < ? super Completable , ? extends Completable > f = onCompletableAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


signature:
public class RxJavaPlugins { /** * Sets the specific hook function .
 * < p > History : 2.0.6 - experimental ; 2.1 - beta
 * @ param handler the hook function to set , null allowed
 * @ since 2.2 */
@ SuppressWarnings ( "rawtypes" ) public static void setOnParallelAssembly ( @ Nullable Function < ? super ParallelFlowable , ? extends ParallelFlowable > handler ) { } }

implementation: if ( lockdown ) { throw new IllegalStateException ( "Plugins can't be changed anymore" ) ; } onParallelAssembly = handler ;


signature:
public class RxJavaPlugins { /** * Calls the associated hook function .
 * < p > History : 2.0.6 - experimental ; 2.1 - beta
 * @ param < T > the value type of the source
 * @ param source the hook ' s input value
 * @ return the value returned by the hook
 * @ since 2.2 */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ NonNull public static < T > ParallelFlowable < T > onAssembly ( @ NonNull ParallelFlowable < T > source ) { Function < ? super ParallelFlowable , ? extends ParallelFlowable > f = onParallelAssembly ; if ( f != null ) { return apply ( f , source ) ; } return source ;


signature:
public class RxJavaPlugins { /** * Called before an operator attempts a blocking operation
 * such as awaiting a condition or signal
 * and should return true to indicate the operator
 * should not block but throw an IllegalArgumentException .
 * < p > History : 2.0.5 - experimental
 * @ return true if the blocking should be prevented
 * @ see # setFailOnNonBlockingScheduler ( boolean )
 * @ since 2.1 */
public static boolean onBeforeBlocking ( ) { } }

implementation: BooleanSupplier f = onBeforeBlocking ; if ( f != null ) { try { return f . getAsBoolean ( ) ; } catch ( Throwable ex ) { throw ExceptionHelper . wrapOrThrow ( ex ) ; } } return false ;


signature:
public class RxJavaPlugins { /** * Create an instance of the default { @ link Scheduler } used for { @ link Schedulers # computation ( ) }
 * except using { @ code threadFactory } for thread creation .
 * < p > History : 2.0.5 - experimental
 * @ param threadFactory thread factory to use for creating worker threads . Note that this takes precedence over any
 * system properties for configuring new thread creation . Cannot be null .
 * @ return the created Scheduler instance
 * @ since 2.1 */
@ NonNull public static Scheduler createComputationScheduler ( @ NonNull ThreadFactory threadFactory ) { } }

implementation: return new ComputationScheduler ( ObjectHelper . requireNonNull ( threadFactory , "threadFactory is null" ) ) ;


signature:
public class RxJavaPlugins { /** * Wraps the call to the function in try - catch and propagates thrown
 * checked exceptions as RuntimeException .
 * @ param < T > the input type
 * @ param < R > the output type
 * @ param f the function to call , not null ( not verified )
 * @ param t the parameter value to the function
 * @ return the result of the function call */
@ NonNull static < T , R > R apply ( @ NonNull Function < T , R > f , @ NonNull T t ) { } }

implementation: try { return f . apply ( t ) ; } catch ( Throwable ex ) { throw ExceptionHelper . wrapOrThrow ( ex ) ; }


signature:
public class RxJavaPlugins { /** * Wraps the call to the function in try - catch and propagates thrown
 * checked exceptions as RuntimeException .
 * @ param < T > the first input type
 * @ param < U > the second input type
 * @ param < R > the output type
 * @ param f the function to call , not null ( not verified )
 * @ param t the first parameter value to the function
 * @ param u the second parameter value to the function
 * @ return the result of the function call */
@ NonNull static < T , U , R > R apply ( @ NonNull BiFunction < T , U , R > f , @ NonNull T t , @ NonNull U u ) { } }

implementation: try { return f . apply ( t , u ) ; } catch ( Throwable ex ) { throw ExceptionHelper . wrapOrThrow ( ex ) ; }


signature:
public class RxJavaPlugins { /** * Wraps the call to the Scheduler creation callable in try - catch and propagates thrown
 * checked exceptions as RuntimeException and enforces that result is not null .
 * @ param s the { @ link Callable } which returns a { @ link Scheduler } , not null ( not verified ) . Cannot return null
 * @ return the result of the callable call , not null
 * @ throws NullPointerException if the callable parameter returns null */
@ NonNull static Scheduler callRequireNonNull ( @ NonNull Callable < Scheduler > s ) { } }

implementation: try { return ObjectHelper . requireNonNull ( s . call ( ) , "Scheduler Callable result can't be null" ) ; } catch ( Throwable ex ) { throw ExceptionHelper . wrapOrThrow ( ex ) ; }


signature:
public class RxJavaPlugins { /** * Wraps the call to the Scheduler creation function in try - catch and propagates thrown
 * checked exceptions as RuntimeException and enforces that result is not null .
 * @ param f the function to call , not null ( not verified ) . Cannot return null
 * @ param s the parameter value to the function
 * @ return the result of the function call , not null
 * @ throws NullPointerException if the function parameter returns null */
@ NonNull static Scheduler applyRequireNonNull ( @ NonNull Function < ? super Callable < Scheduler > , ? extends Scheduler > f , Callable < Scheduler > s ) { } }

implementation: return ObjectHelper . requireNonNull ( apply ( f , s ) , "Scheduler Callable result can't be null" ) ;


signature:
public class Maybe { /** * Runs multiple MaybeSources and signals the events of the first one that signals ( disposing
 * the rest ) .
 * < img width = " 640 " height = " 519 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . amb . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code amb } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources the Iterable sequence of sources . A subscription to each source will
 * occur in the same order as in the Iterable .
 * @ return the new Maybe instance */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > amb ( final Iterable < ? extends MaybeSource < ? extends T > > sources ) { } }

implementation: ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeAmb < T > ( null , sources ) ) ;


signature:
public class Maybe { /** * Runs multiple MaybeSources and signals the events of the first one that signals ( disposing
 * the rest ) .
 * < img width = " 640 " height = " 519 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . ambArray . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code ambArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources the array of sources . A subscription to each source will
 * occur in the same order as in the array .
 * @ return the new Maybe instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( "unchecked" ) public static < T > Maybe < T > ambArray ( final MaybeSource < ? extends T > ... sources ) { } }

implementation: if ( sources . length == 0 ) { return empty ( ) ; } if ( sources . length == 1 ) { return wrap ( ( MaybeSource < T > ) sources [ 0 ] ) ; } return RxJavaPlugins . onAssembly ( new MaybeAmb < T > ( sources , null ) ) ;


signature:
public class Maybe { /** * Concatenate the single values , in a non - overlapping fashion , of the MaybeSource sources provided by
 * a Publisher sequence .
 * < img width = " 640 " height = " 416 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . concat . p . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The returned { @ code Flowable } honors the backpressure of the downstream consumer and
 * expects the { @ code Publisher } to honor backpressure as well . If the sources { @ code Publisher }
 * violates this , a { @ link io . reactivex . exceptions . MissingBackpressureException } is signalled . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concat } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources the Publisher of MaybeSource instances
 * @ return the new Flowable instance */
@ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > concat ( Publisher < ? extends MaybeSource < ? extends T > > sources ) { } }

implementation: return concat ( sources , 2 ) ;


signature:
public class Maybe { /** * Concatenates a variable number of MaybeSource sources and delays errors from any of them
 * till all terminate .
 * < img width = " 640 " height = " 425 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . concatArrayDelayError . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concatArrayDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param sources the array of sources
 * @ param < T > the common base value type
 * @ return the new Flowable instance
 * @ throws NullPointerException if sources is null */
@ SuppressWarnings ( "unchecked" ) @ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > concatArrayDelayError ( MaybeSource < ? extends T > ... sources ) { } }

implementation: if ( sources . length == 0 ) { return Flowable . empty ( ) ; } else if ( sources . length == 1 ) { return RxJavaPlugins . onAssembly ( new MaybeToFlowable < T > ( ( MaybeSource < T > ) sources [ 0 ] ) ) ; } return RxJavaPlugins . onAssembly ( new MaybeConcatArrayDelayError < T > ( sources ) ) ;


signature:
public class Maybe { /** * Concatenates a sequence of MaybeSource eagerly into a single stream of values .
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source MaybeSources . The operator buffers the value emitted by these MaybeSources and then drains them
 * in order , each one after the previous one completes .
 * < img width = " 640 " height = " 489 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . concatArrayEager . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources a sequence of MaybeSources that need to be eagerly concatenated
 * @ return the new Flowable instance with the specified concatenation behavior */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > concatArrayEager ( MaybeSource < ? extends T > ... sources ) { return Flowable . fromArray ( sources ) . concatMapEager ( ( Function ) MaybeToPublisher . instance ( ) ) ;


signature:
public class Maybe { /** * Concatenates a sequence of MaybeSources eagerly into a single stream of values .
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source MaybeSources . The operator buffers the values emitted by these MaybeSources and then drains them
 * in order , each one after the previous one completes .
 * < img width = " 640 " height = " 526 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . concatEager . i . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > Backpressure is honored towards the downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources a sequence of MaybeSource that need to be eagerly concatenated
 * @ return the new Flowable instance with the specified concatenation behavior */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > concatEager ( Iterable < ? extends MaybeSource < ? extends T > > sources ) { return Flowable . fromIterable ( sources ) . concatMapEager ( ( Function ) MaybeToPublisher . instance ( ) ) ;


signature:
public class Maybe { /** * Provides an API ( via a cold Maybe ) that bridges the reactive world with the callback - style world .
 * Example :
 * < pre > < code >
 * Maybe . & lt ; Event & gt ; create ( emitter - & gt ; {
 * Callback listener = new Callback ( ) {
 * & # 64 ; Override
 * public void onEvent ( Event e ) {
 * if ( e . isNothing ( ) ) {
 * emitter . onComplete ( ) ;
 * } else {
 * emitter . onSuccess ( e ) ;
 * & # 64 ; Override
 * public void onFailure ( Exception e ) {
 * emitter . onError ( e ) ;
 * AutoCloseable c = api . someMethod ( listener ) ;
 * emitter . setCancellable ( c : : close ) ;
 * < / code > < / pre >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code create } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param onSubscribe the emitter that is called when a MaybeObserver subscribes to the returned { @ code Maybe }
 * @ return the new Maybe instance
 * @ see MaybeOnSubscribe
 * @ see Cancellable */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > create ( MaybeOnSubscribe < T > onSubscribe ) { } }

implementation: ObjectHelper . requireNonNull ( onSubscribe , "onSubscribe is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeCreate < T > ( onSubscribe ) ) ;


signature:
public class Maybe { /** * Calls a Callable for each individual MaybeObserver to return the actual MaybeSource source to
 * be subscribed to .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code defer } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param maybeSupplier the Callable that is called for each individual MaybeObserver and
 * returns a MaybeSource instance to subscribe to
 * @ return the new Maybe instance */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > defer ( final Callable < ? extends MaybeSource < ? extends T > > maybeSupplier ) { } }

implementation: ObjectHelper . requireNonNull ( maybeSupplier , "maybeSupplier is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeDefer < T > ( maybeSupplier ) ) ;


signature:
public class Maybe { /** * Returns a ( singleton ) Maybe instance that calls { @ link MaybeObserver # onComplete onComplete }
 * immediately .
 * < img width = " 640 " height = " 190 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / empty . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code empty } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ return the new Maybe instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( "unchecked" ) public static < T > Maybe < T > empty ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( ( Maybe < T > ) MaybeEmpty . INSTANCE ) ;


signature:
public class Maybe { /** * Returns a Maybe that invokes a subscriber ' s { @ link MaybeObserver # onError onError } method when the
 * subscriber subscribes to it .
 * < img width = " 640 " height = " 447 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . error . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code error } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param exception
 * the particular Throwable to pass to { @ link MaybeObserver # onError onError }
 * @ param < T >
 * the type of the item ( ostensibly ) emitted by the Maybe
 * @ return a Maybe that invokes the subscriber ' s { @ link MaybeObserver # onError onError } method when
 * the subscriber subscribes to it
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Throw < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > error ( Throwable exception ) { } }

implementation: ObjectHelper . requireNonNull ( exception , "exception is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeError < T > ( exception ) ) ;


signature:
public class Maybe { /** * Returns a Maybe that invokes a { @ link MaybeObserver } ' s { @ link MaybeObserver # onError onError } method when the
 * MaybeObserver subscribes to it .
 * < img width = " 640 " height = " 190 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / error . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code error } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param supplier
 * a Callable factory to return a Throwable for each individual MaybeObserver
 * @ param < T >
 * the type of the items ( ostensibly ) emitted by the Maybe
 * @ return a Maybe that invokes the { @ link MaybeObserver } ' s { @ link MaybeObserver # onError onError } method when
 * the MaybeObserver subscribes to it
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Throw < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > error ( Callable < ? extends Throwable > supplier ) { } }

implementation: ObjectHelper . requireNonNull ( supplier , "errorSupplier is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeErrorCallable < T > ( supplier ) ) ;


signature:
public class Maybe { /** * Wraps a CompletableSource into a Maybe .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromCompletable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the target type
 * @ param completableSource the CompletableSource to convert from
 * @ return the new Maybe instance
 * @ throws NullPointerException if completable is null */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromCompletable ( CompletableSource completableSource ) { } }

implementation: ObjectHelper . requireNonNull ( completableSource , "completableSource is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromCompletable < T > ( completableSource ) ) ;


signature:
public class Maybe { /** * Wraps a SingleSource into a Maybe .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the target type
 * @ param singleSource the SingleSource to convert from
 * @ return the new Maybe instance
 * @ throws NullPointerException if single is null */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromSingle ( SingleSource < T > singleSource ) { } }

implementation: ObjectHelper . requireNonNull ( singleSource , "singleSource is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromSingle < T > ( singleSource ) ) ;


signature:
public class Maybe { /** * Returns a { @ link Maybe } that invokes the given { @ link Callable } for each individual { @ link MaybeObserver } that
 * subscribes and emits the resulting non - null item via { @ code onSuccess } while
 * considering a { @ code null } result from the { @ code Callable } as indication for valueless completion
 * via { @ code onComplete } .
 * This operator allows you to defer the execution of the given { @ code Callable } until a { @ code MaybeObserver }
 * subscribes to the returned { @ link Maybe } . In other terms , this source operator evaluates the given
 * { @ code Callable } " lazily " .
 * Note that the { @ code null } handling of this operator differs from the similar source operators in the other
 * { @ link io . reactivex base reactive classes } . Those operators signal a { @ code NullPointerException } if the value returned by their
 * { @ code Callable } is { @ code null } while this { @ code fromCallable } considers it to indicate the
 * returned { @ code Maybe } is empty .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromCallable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > Any non - fatal exception thrown by { @ link Callable # call ( ) } will be forwarded to { @ code onError } ,
 * except if the { @ code MaybeObserver } disposed the subscription in the meantime . In this latter case ,
 * the exception is forwarded to the global error handler via
 * { @ link io . reactivex . plugins . RxJavaPlugins # onError ( Throwable ) } wrapped into a
 * { @ link io . reactivex . exceptions . UndeliverableException UndeliverableException } .
 * Fatal exceptions are rethrown and usually will end up in the executing thread ' s
 * { @ link java . lang . Thread . UncaughtExceptionHandler # uncaughtException ( Thread , Throwable ) } handler . < / dd >
 * < / dl >
 * @ param callable
 * a { @ link Callable } instance whose execution should be deferred and performed for each individual
 * { @ code MaybeObserver } that subscribes to the returned { @ link Maybe } .
 * @ param < T >
 * the type of the item emitted by the { @ link Maybe } .
 * @ return a new Maybe instance */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromCallable ( @ NonNull final Callable < ? extends T > callable ) { } }

implementation: ObjectHelper . requireNonNull ( callable , "callable is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromCallable < T > ( callable ) ) ;


signature:
public class Maybe { /** * Converts a { @ link Future } into a Maybe , treating a null result as an indication of emptiness .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / from . Future . png " alt = " " >
 * You can convert any object that supports the { @ link Future } interface into a Maybe that emits the
 * return value of the { @ link Future # get } method of that object , by passing the object into the { @ code from }
 * method .
 * < em > Important note : < / em > This Maybe is blocking ; you cannot dispose it .
 * Unlike 1 . x , disposing the Maybe won ' t cancel the future . If necessary , one can use composition to achieve the
 * cancellation effect : { @ code futureMaybe . doOnDispose ( ( ) - > future . cancel ( true ) ) ; } .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromFuture } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param future
 * the source { @ link Future }
 * @ param < T >
 * the type of object that the { @ link Future } returns , and also the type of item to be emitted by
 * the resulting Maybe
 * @ return a Maybe that emits the item from the source { @ link Future }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / from . html " > ReactiveX operators documentation : From < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromFuture ( Future < ? extends T > future ) { } }

implementation: ObjectHelper . requireNonNull ( future , "future is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromFuture < T > ( future , 0L , null ) ) ;


signature:
public class Maybe { /** * Converts a { @ link Future } into a Maybe , with a timeout on the Future .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / from . Future . png " alt = " " >
 * You can convert any object that supports the { @ link Future } interface into a Maybe that emits the
 * return value of the { @ link Future # get } method of that object , by passing the object into the { @ code fromFuture }
 * method .
 * Unlike 1 . x , disposing the Maybe won ' t cancel the future . If necessary , one can use composition to achieve the
 * cancellation effect : { @ code futureMaybe . doOnCancel ( ( ) - > future . cancel ( true ) ) ; } .
 * < em > Important note : < / em > This Maybe is blocking on the thread it gets subscribed on ; you cannot dispose it .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromFuture } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param future
 * the source { @ link Future }
 * @ param timeout
 * the maximum time to wait before calling { @ code get }
 * @ param unit
 * the { @ link TimeUnit } of the { @ code timeout } argument
 * @ param < T >
 * the type of object that the { @ link Future } returns , and also the type of item to be emitted by
 * the resulting Maybe
 * @ return a Maybe that emits the item from the source { @ link Future }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / from . html " > ReactiveX operators documentation : From < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromFuture ( Future < ? extends T > future , long timeout , TimeUnit unit ) { } }

implementation: ObjectHelper . requireNonNull ( future , "future is null" ) ; ObjectHelper . requireNonNull ( unit , "unit is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromFuture < T > ( future , timeout , unit ) ) ;


signature:
public class Maybe { /** * Returns a Maybe instance that runs the given Action for each subscriber and
 * emits either its exception or simply completes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromRunnable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the target type
 * @ param run the runnable to run for each subscriber
 * @ return the new Maybe instance
 * @ throws NullPointerException if run is null */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > fromRunnable ( final Runnable run ) { } }

implementation: ObjectHelper . requireNonNull ( run , "run is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeFromRunnable < T > ( run ) ) ;


signature:
public class Maybe { /** * Returns a { @ code Maybe } that emits a specified item .
 * < img width = " 640 " height = " 485 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / Maybe . just . png " alt = " " >
 * To convert any object into a { @ code Maybe } that emits that object , pass that object into the
 * { @ code just } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code just } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param item
 * the item to emit
 * @ param < T >
 * the type of that item
 * @ return a { @ code Maybe } that emits { @ code item }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / just . html " > ReactiveX operators documentation : Just < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Maybe < T > just ( T item ) { } }

implementation: ObjectHelper . requireNonNull ( item , "item is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeJust < T > ( item ) ) ;


signature:
public class Maybe { /** * Merges a Flowable sequence of MaybeSource instances into a single Flowable sequence ,
 * running all MaybeSources at once .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code merge } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If any of the source { @ code MaybeSource } s signal a { @ code Throwable } via { @ code onError } , the resulting
 * { @ code Flowable } terminates with that { @ code Throwable } and all other source { @ code MaybeSource } s are disposed .
 * If more than one { @ code MaybeSource } signals an error , the resulting { @ code Flowable } may terminate with the
 * first one ' s error or , depending on the concurrency of the sources , may terminate with a
 * { @ code CompositeException } containing two or more of the various error signals .
 * { @ code Throwable } s that didn ' t make into the composite will be sent ( individually ) to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors . Similarly , { @ code Throwable } s
 * signaled by source ( s ) after the returned { @ code Flowable } has been cancelled or terminated with a
 * ( composite ) error will be sent to the same global error handler .
 * Use { @ link # mergeDelayError ( Publisher ) } to merge sources and terminate only when all source { @ code MaybeSource } s
 * have completed or failed with an error .
 * < / dd >
 * < / dl >
 * @ param < T > the common and resulting value type
 * @ param sources the Flowable sequence of MaybeSource sources
 * @ return the new Flowable instance
 * @ see # mergeDelayError ( Publisher ) */
@ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > merge ( Publisher < ? extends MaybeSource < ? extends T > > sources ) { } }

implementation: return merge ( sources , Integer . MAX_VALUE ) ;


signature:
public class Maybe { /** * Flattens an array of MaybeSources into one Flowable , in a way that allows a Subscriber to receive all
 * successfully emitted items from each of the source MaybeSources without being interrupted by an error
 * notification from one of them .
 * This behaves like { @ link # merge ( Publisher ) } except that if any of the merged MaybeSources notify of an
 * error via { @ link Subscriber # onError onError } , { @ code mergeDelayError } will refrain from propagating that
 * error notification until all of the merged MaybeSources have finished emitting items .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeDelayError . png " alt = " " >
 * Even if multiple merged MaybeSources send { @ code onError } notifications , { @ code mergeDelayError } will only
 * invoke the { @ code onError } method of its Subscribers once .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeArrayDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * the Iterable of MaybeSources
 * @ return a Flowable that emits items that are the result of flattening the items emitted by the
 * MaybeSources in the Iterable
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a > */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > mergeArrayDelayError ( MaybeSource < ? extends T > ... sources ) { if ( sources . length == 0 ) { return Flowable . empty ( ) ; } return Flowable . fromArray ( sources ) . flatMap ( ( Function ) MaybeToPublisher . instance ( ) , true , sources . length ) ;


signature:
public class Maybe { /** * Flattens an Iterable of MaybeSources into one Flowable , in a way that allows a Subscriber to receive all
 * successfully emitted items from each of the source MaybeSources without being interrupted by an error
 * notification from one of them .
 * This behaves like { @ link # merge ( Publisher ) } except that if any of the merged MaybeSources notify of an
 * error via { @ link Subscriber # onError onError } , { @ code mergeDelayError } will refrain from propagating that
 * error notification until all of the merged MaybeSources have finished emitting items .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeDelayError . png " alt = " " >
 * Even if multiple merged MaybeSources send { @ code onError } notifications , { @ code mergeDelayError } will only
 * invoke the { @ code onError } method of its Subscribers once .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * the Iterable of MaybeSources
 * @ return a Flowable that emits items that are the result of flattening the items emitted by the
 * MaybeSources in the Iterable
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a > */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ BackpressureSupport ( BackpressureKind . FULL ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Flowable < T > mergeDelayError ( Iterable < ? extends MaybeSource < ? extends T > > sources ) { return Flowable . fromIterable ( sources ) . flatMap ( ( Function ) MaybeToPublisher . instance ( ) , true ) ;


signature:
public class Maybe { /** * Returns a Maybe that never sends any items or notifications to a { @ link MaybeObserver } .
 * < img width = " 640 " height = " 185 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / never . png " alt = " " >
 * This Maybe is useful primarily for testing purposes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code never } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T >
 * the type of items ( not ) emitted by the Maybe
 * @ return a Maybe that never emits any items or sends any notifications to a { @ link MaybeObserver }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Never < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( "unchecked" ) public static < T > Maybe < T > never ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( ( Maybe < T > ) MaybeNever . INSTANCE ) ;


signature:
public class Maybe { /** * Returns a Single that emits a Boolean value that indicates whether two MaybeSource sequences are the
 * same by comparing the items emitted by each MaybeSource pairwise .
 * < img width = " 640 " height = " 385 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sequenceEqual . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequenceEqual } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param source1
 * the first MaybeSource to compare
 * @ param source2
 * the second MaybeSource to compare
 * @ param < T >
 * the type of items emitted by each MaybeSource
 * @ return a Single that emits a Boolean value that indicates whether the two sequences are the same
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sequenceequal . html " > ReactiveX operators documentation : SequenceEqual < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Single < Boolean > sequenceEqual ( MaybeSource < ? extends T > source1 , MaybeSource < ? extends T > source2 ) { } }

implementation: return sequenceEqual ( source1 , source2 , ObjectHelper . equalsPredicate ( ) ) ;