Enum InternalObservableUtils

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<InternalObservableUtils>

    public enum InternalObservableUtils
    extends java.lang.Enum<InternalObservableUtils>
    Holder of named utility classes factored out from Observable to save source space and help with debugging with properly named objects.
    • Constructor Detail

      • InternalObservableUtils

        private InternalObservableUtils()
    • Method Detail

      • values

        public static InternalObservableUtils[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (InternalObservableUtils c : InternalObservableUtils.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static InternalObservableUtils valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • equalsWith

        public static Func1<java.lang.Object,​java.lang.Boolean> equalsWith​(java.lang.Object other)
        Returns a Func1 that checks if its argument is null-safe equals with the given constant reference.
        Parameters:
        other - the other object to check against (nulls allowed)
        Returns:
        the comparison function
      • isInstanceOf

        public static Func1<java.lang.Object,​java.lang.Boolean> isInstanceOf​(java.lang.Class<?> clazz)
        Returns a Func1 that checks if its argument is an instance of the supplied class.
        Parameters:
        clazz - the class to check against
        Returns:
        the comparison function
      • createRepeatDematerializer

        public static final Func1<Observable<? extends Notification<?>>,​Observable<?>> createRepeatDematerializer​(Func1<? super Observable<? extends java.lang.Void>,​? extends Observable<?>> notificationHandler)
        Returns a function that dematerializes the notification signal from an Observable and calls a notification handler with a null for non-terminal events.
        Parameters:
        notificationHandler - the handler to notify with nulls
        Returns:
        the Func1 instance
      • createReplaySelectorAndObserveOn

        public static <T,​R> Func1<Observable<T>,​Observable<R>> createReplaySelectorAndObserveOn​(Func1<? super Observable<T>,​? extends Observable<R>> selector,
                                                                                                            Scheduler scheduler)
        Creates a Func1 which calls the selector function with the received argument, applies an observeOn on the result and returns the resulting Observable.
        Type Parameters:
        T - the input value type
        R - the output value type
        Parameters:
        selector - the selector function
        scheduler - the scheduler to apply on the output of the selector
        Returns:
        the new Func1 instance
      • createRetryDematerializer

        public static final Func1<Observable<? extends Notification<?>>,​Observable<?>> createRetryDematerializer​(Func1<? super Observable<? extends java.lang.Throwable>,​? extends Observable<?>> notificationHandler)
        Returns a function that dematerializes the notification signal from an Observable and calls a notification handler with the Throwable.
        Parameters:
        notificationHandler - the handler to notify with Throwables
        Returns:
        the Func1 instance
      • createReplaySupplier

        public static <T> Func0<ConnectableObservable<T>> createReplaySupplier​(Observable<T> source)
        Returns a Func0 that supplies the ConnectableObservable returned by calling replay() on the source.
        Type Parameters:
        T - the input value type
        Parameters:
        source - the source to call replay on by the supplier function
        Returns:
        the new Func0 instance
      • createReplaySupplier

        public static <T> Func0<ConnectableObservable<T>> createReplaySupplier​(Observable<T> source,
                                                                               int bufferSize)
        Returns a Func0 that supplies the ConnectableObservable returned by calling a parameterized replay() on the source.
        Type Parameters:
        T - the input value type
        Parameters:
        source - the source to call replay on by the supplier function
        bufferSize - the buffer size that limits the number of items the connectable observable can replay
        Returns:
        the new Func0 instance
      • createReplaySupplier

        public static <T> Func0<ConnectableObservable<T>> createReplaySupplier​(Observable<T> source,
                                                                               long time,
                                                                               java.util.concurrent.TimeUnit unit,
                                                                               Scheduler scheduler)
        Returns a Func0 that supplies the ConnectableObservable returned by calling a parameterized replay() on the source.
        Type Parameters:
        T - the input value type
        Parameters:
        source - the source to call replay on by the supplier function
        time - the duration of the window in which the replayed items must have been emitted
        unit - the time unit of time
        scheduler - the scheduler to use for timing information
        Returns:
        the new Func0 instance
      • createReplaySupplier

        public static <T> Func0<ConnectableObservable<T>> createReplaySupplier​(Observable<T> source,
                                                                               int bufferSize,
                                                                               long time,
                                                                               java.util.concurrent.TimeUnit unit,
                                                                               Scheduler scheduler)
        Returns a Func0 that supplies the ConnectableObservable returned by calling a parameterized replay() on the source.
        Type Parameters:
        T - the input value type
        Parameters:
        source - the source to call replay on by the supplier function
        bufferSize - the buffer size that limits the number of items the connectable observable can replay
        time - the duration of the window in which the replayed items must have been emitted
        unit - the time unit of time
        scheduler - the scheduler to use for timing information
        Returns:
        the new Func0 instance
      • createCollectorCaller

        public static <T,​R> Func2<R,​T,​R> createCollectorCaller​(Action2<R,​? super T> collector)
        Returns a Func2 which calls a collector with its parameters and returns the first (R) parameter.
        Type Parameters:
        T - the input value type
        R - the result value type
        Parameters:
        collector - the collector action to call
        Returns:
        the new Func2 instance