Enum Fn2.Singletons

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Fn2.Singletons>, java.util.function.BiFunction, Fn2
    Enclosing interface:
    Fn2<A,​B,​R>

    public static enum Fn2.Singletons
    extends java.lang.Enum<Fn2.Singletons>
    implements Fn2
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.organicdesign.fp.function.Fn2

        Fn2.Singletons
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FIRST
      A static function that always returns the first argument it is given.
      SECOND
      A static function that always returns the second argument it is given.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Fn2.Singletons valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Fn2.Singletons[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.function.BiFunction

        andThen
      • Methods inherited from interface org.organicdesign.fp.function.Fn2

        apply, applyEx
    • Enum Constant Detail

      • FIRST

        public static final Fn2.Singletons FIRST
        A static function that always returns the first argument it is given. For type safety, please use Fn2.first() instead of accessing this dirctly.
      • SECOND

        public static final Fn2.Singletons SECOND
        A static function that always returns the second argument it is given. For type safety, please use Fn2.second() instead of accessing this dirctly.
    • Method Detail

      • values

        public static Fn2.Singletons[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Fn2.Singletons c : Fn2.Singletons.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Fn2.Singletons valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null