Class OperatorDistinctUntilChanged<T,​U>

  • Type Parameters:
    T - the value type
    U - the key type
    All Implemented Interfaces:
    Func1<Subscriber<? super T>,​Subscriber<? super T>>, Func2<U,​U,​java.lang.Boolean>, Function, Observable.Operator<T,​T>

    public final class OperatorDistinctUntilChanged<T,​U>
    extends java.lang.Object
    implements Observable.Operator<T,​T>, Func2<U,​U,​java.lang.Boolean>
    Returns an Observable that emits all sequentially distinct items emitted by the source.
    • Field Detail

      • keySelector

        final Func1<? super T,​? extends U> keySelector
      • comparator

        final Func2<? super U,​? super U,​java.lang.Boolean> comparator
    • Constructor Detail

      • OperatorDistinctUntilChanged

        public OperatorDistinctUntilChanged​(Func1<? super T,​? extends U> keySelector)
      • OperatorDistinctUntilChanged

        public OperatorDistinctUntilChanged​(Func2<? super U,​? super U,​java.lang.Boolean> comparator)
    • Method Detail

      • instance

        public static <T> OperatorDistinctUntilChanged<T,​T> instance()
        Returns a singleton instance of OperatorDistinctUntilChanged that was built using the identity function for comparison (new OperatorDistinctUntilChanged(UtilityFunctions.identity())).
        Type Parameters:
        T - the value type
        Returns:
        Operator that emits sequentially distinct values only using the identity function for comparison
      • call

        public java.lang.Boolean call​(U t1,
                                      U t2)
        Specified by:
        call in interface Func2<U,​U,​java.lang.Boolean>