Class Functions


  • public final class Functions
    extends java.lang.Object
    Factory methods for several common functions.
    Since:
    4.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <K> FunctionEx<java.util.Map.Entry<K,​?>,​K> entryKey()
      Returns a function that extracts the key of a Map.Entry.
      static <V> FunctionEx<java.util.Map.Entry<?,​V>,​V> entryValue()
      Returns a function that extracts the value of a Map.Entry.
      static <T> FunctionEx<T,​T> wholeItem()
      Synonym for FunctionEx.identity(), to be used as a projection function (e.g., key extractor).
      • Methods inherited from class java.lang.Object

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

      • wholeItem

        @Nonnull
        public static <T> FunctionEx<T,​T> wholeItem()
        Synonym for FunctionEx.identity(), to be used as a projection function (e.g., key extractor).
        Type Parameters:
        T - the type of the input and output objects to the function
      • entryKey

        @Nonnull
        public static <K> FunctionEx<java.util.Map.Entry<K,​?>,​K> entryKey()
        Returns a function that extracts the key of a Map.Entry.
        Type Parameters:
        K - type of entry's key
      • entryValue

        @Nonnull
        public static <V> FunctionEx<java.util.Map.Entry<?,​V>,​V> entryValue()
        Returns a function that extracts the value of a Map.Entry.
        Type Parameters:
        V - type of entry's value