Class Functions


  • public class Functions
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Functions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> Function<E,​E> identity()
      Returns the identity function.
      static Function<java.lang.Object,​java.lang.String> toStringFunction()
      Returns a function that calls toString() on its argument.
      • Methods inherited from class java.lang.Object

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

      • Functions

        public Functions()
    • Method Detail

      • identity

        public static <E> Function<E,​E> identity()
        Returns the identity function.
      • toStringFunction

        public static Function<java.lang.Object,​java.lang.String> toStringFunction()
        Returns a function that calls toString() on its argument. The function does not accept nulls; it will throw a NullPointerException when applied to null.

        Warning: The returned function may not be consistent with equals (as documented at Function.apply(T)). For example, this function yields different results for the two equal instances ImmutableSet.of(1, 2) and ImmutableSet.of(2, 1).