Apache REEF
0.15.0
Retainable Evaluator Execution Framework
|
A convenience class that indicates whether a variable is set or not. More...
Public Member Functions | |
T | OrElse (T other) |
Returns other if the current Optional<T> is empty. More... | |
bool | IsPresent () |
Returns true if the current Optional<T> is empty, false otherwise. More... | |
override bool | Equals (object obj) |
Tests the equality of the underlying Value. More... | |
override int | GetHashCode () |
Gets the hashcode of the underlying Value. More... | |
override string | ToString () |
Static Public Member Functions | |
static Optional< T > | Of (T value) |
Creates an Optional<T> with Value of parameter value. More... | |
static Optional< T > | Empty () |
Creates an empty Optional<T>. More... | |
static Optional< T > | OfNullable (T value) |
Creates an Optional<T> with Value of parameter value. More... | |
Properties | |
T | Value [get] |
Gets the Value associated with the Optional<T> object. More... | |
A convenience class that indicates whether a variable is set or not.
The generic type T can either be of nullable or non-nullable type.
|
inlinestatic |
Creates an empty Optional<T>.
|
inline |
Tests the equality of the underlying Value.
|
inline |
Gets the hashcode of the underlying Value.
|
inline |
|
inlinestatic |
Creates an Optional<T> with Value of parameter value.
If T is nullable and null is passed in, an ArgumentNullException will be thrown. If T is non-nullable and default(T) is passed in, a non-empty Optional<T> object will be returned.
|
inlinestatic |
Creates an Optional<T> with Value of parameter value.
If T is nullable and null is passed in, an empty Optional<T> will be returned. If T is non-nullable and default(T) is passed in, a non-empty Optional<T> object will be returned.
|
inline |
Returns other if the current Optional<T> is empty.
|
inline |
|
get |
Gets the Value associated with the Optional<T> object.
If empty and T is nullable, the Value will return null. If empty and T is non-nullable, the Value will return default(T).