Class UtilityFunctions


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

      Constructors 
      Modifier Constructor Description
      private UtilityFunctions()
      Utility class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> Func1<? super T,​java.lang.Boolean> alwaysFalse()
      Returns a function that always returns false.
      static <T> Func1<? super T,​java.lang.Boolean> alwaysTrue()
      Returns a function that always returns true.
      static <T> Func1<T,​T> identity()
      Returns a function that always returns the Object it is passed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UtilityFunctions

        private UtilityFunctions()
        Utility class.
    • Method Detail

      • alwaysTrue

        public static <T> Func1<? super T,​java.lang.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,​java.lang.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