play.libs
Class F

java.lang.Object
  extended by play.libs.F

public class F
extends java.lang.Object

Defines a set of functional programming style helpers.


Nested Class Summary
static interface F.Callback<A>
          A Callback with a single argument.
static interface F.Callback0
          A Callback with no arguments.
static interface F.Callback2<A,B>
          A Callback with 2 arguments.
static interface F.Callback3<A,B,C>
          A Callback with 3 arguments.
static class F.Either<A,B>
          Represents a value of one of two possible types (a disjoint union)
static interface F.Function<A,R>
          A Function with a single argument.
static interface F.Function0<R>
          A Function with no arguments.
static interface F.Function2<A,B,R>
          A Function with 2 arguments.
static interface F.Function3<A,B,C,R>
          A Function with 3 arguments.
static class F.None<T>
          Represents non-existent values.
static class F.Option<T>
          Represents optional values.
static class F.Promise<A>
          A promise to produce a result of type A.
static class F.Some<T>
          Represents existing values of type T.
static class F.Tuple<A,B>
          A pair - a tuple of the types A and B.
static class F.Tuple3<A,B,C>
          A tuple of A,B,C
static class F.Tuple4<A,B,C,D>
          A tuple of A,B,C,D
static class F.Tuple5<A,B,C,D,E>
          A tuple of A,B,C,D,E
 
Constructor Summary
F()
           
 
Method Summary
static F.None None()
          Constructs a None value.
static
<A> F.Some<A>
Some(A value)
          Construct a Some value.
static
<A,B> F.Tuple<A,B>
Tuple(A a, B b)
          Constructs a tuple of A,B
static
<A,B,C> F.Tuple3<A,B,C>
Tuple3(A a, B b, C c)
          Constructs a tuple of A,B,C
static
<A,B,C,D> F.Tuple4<A,B,C,D>
Tuple4(A a, B b, C c, D d)
          Constructs a tuple of A,B,C,D
static
<A,B,C,D,E>
F.Tuple5<A,B,C,D,E>
Tuple5(A a, B b, C c, D d, E e)
          Constructs a tuple of A,B,C,D,E
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

F

public F()
Method Detail

Some

public static <A> F.Some<A> Some(A value)
Construct a Some value.

Parameters:
value - The value
Returns:
Some value.

None

public static F.None None()
Constructs a None value.

Returns:
None.

Tuple

public static <A,B> F.Tuple<A,B> Tuple(A a,
                                       B b)
Constructs a tuple of A,B

Parameters:
a - The a value
b - The b value
Returns:
The tuple

Tuple3

public static <A,B,C> F.Tuple3<A,B,C> Tuple3(A a,
                                             B b,
                                             C c)
Constructs a tuple of A,B,C

Parameters:
a - The a value
b - The b value
c - The c value
Returns:
The tuple

Tuple4

public static <A,B,C,D> F.Tuple4<A,B,C,D> Tuple4(A a,
                                                 B b,
                                                 C c,
                                                 D d)
Constructs a tuple of A,B,C,D

Parameters:
a - The a value
b - The b value
c - The c value
d - The d value
Returns:
The tuple

Tuple5

public static <A,B,C,D,E> F.Tuple5<A,B,C,D,E> Tuple5(A a,
                                                     B b,
                                                     C c,
                                                     D d,
                                                     E e)
Constructs a tuple of A,B,C,D,E

Parameters:
a - The a value
b - The b value
c - The c value
d - The d value
e - The e value
Returns:
The tuple