Class UtilityFunctions

java.lang.Object
rx.internal.util.UtilityFunctions

public final class UtilityFunctions extends Object
Utility functions for internal use that we don't want part of the public API.
  • Constructor Details

    • UtilityFunctions

      private UtilityFunctions()
      Utility class.
  • Method Details

    • alwaysTrue

      public static <T> Func1<? super T,Boolean> alwaysTrue()
      Returns a function that always returns true.
      Type Parameters:
      T - the value type
      Returns:
      a Func1 that accepts an Object and returns the Boolean true
    • alwaysFalse

      public static <T> Func1<? super T,Boolean> alwaysFalse()
      Returns a function that always returns false.
      Type Parameters:
      T - the value type
      Returns:
      a Func1 that accepts an Object and returns the Boolean false
    • identity

      public static <T> Func1<T,T> identity()
      Returns a function that always returns the Object it is passed.
      Type Parameters:
      T - the input and output value type
      Returns:
      a Func1 that accepts an Object and returns the same Object