play.libs
Class F.Option<T>

java.lang.Object
  extended by play.libs.F.Option<T>
All Implemented Interfaces:
java.lang.Iterable<T>
Direct Known Subclasses:
F.None, F.Some
Enclosing class:
F

public abstract static class F.Option<T>
extends java.lang.Object
implements java.lang.Iterable<T>

Represents optional values. Instances of Option are either an instance of Some or the object None.


Constructor Summary
F.Option()
           
 
Method Summary
abstract  T get()
          Returns the value if defined.
 T getOrElse(T defaultValue)
           
abstract  boolean isDefined()
          Returns true if this value is defined.
<A> F.Option<A>
map(F.Function<T,A> f)
           
static
<T> F.None<T>
None()
          Constructs a None value.
static
<T> F.Some<T>
Some(T value)
          Construct a Some value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

F.Option

public F.Option()
Method Detail

isDefined

public abstract boolean isDefined()
Returns true if this value is defined.


get

public abstract T get()
Returns the value if defined.


None

public static <T> F.None<T> None()
Constructs a None value.


Some

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


getOrElse

public T getOrElse(T defaultValue)

map

public <A> F.Option<A> map(F.Function<T,A> f)