Enum Class InternalObservableUtils

java.lang.Object
java.lang.Enum<InternalObservableUtils>
rx.internal.util.InternalObservableUtils
All Implemented Interfaces:
Serializable, Comparable<InternalObservableUtils>, Constable

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

  • Constructor Details

    • InternalObservableUtils

      private InternalObservableUtils()
  • Method Details

    • values

      public static InternalObservableUtils[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static InternalObservableUtils valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • equalsWith

      public static Func1<Object,Boolean> equalsWith(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<Object,Boolean> isInstanceOf(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 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 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, 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, 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