This project has retired. For details please refer to its Attic page.
Apache REEF: Org.Apache.REEF.Utilities.Optional< T > Class Template Reference
Apache REEF  0.15.0
Retainable Evaluator Execution Framework
Public Member Functions | Static Public Member Functions | Properties | List of all members
Org.Apache.REEF.Utilities.Optional< T > Class Template Reference

A convenience class that indicates whether a variable is set or not. More...

Public Member Functions

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

Value [get]
 Gets the Value associated with the Optional<T> object. More...
 

Detailed Description

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.

Member Function Documentation

static Optional<T> Org.Apache.REEF.Utilities.Optional< T >.Empty ( )
inlinestatic

Creates an empty Optional<T>.

override bool Org.Apache.REEF.Utilities.Optional< T >.Equals ( object  obj)
inline

Tests the equality of the underlying Value.

override int Org.Apache.REEF.Utilities.Optional< T >.GetHashCode ( )
inline

Gets the hashcode of the underlying Value.

Returns
bool Org.Apache.REEF.Utilities.Optional< T >.IsPresent ( )
inline

Returns true if the current Optional<T> is empty, false otherwise.

For nullable T, the Optional<T> is empty if Value is null. For non-nullable T, the Optional<T> is empty if Optional<T> is created with Empty.

static Optional<T> Org.Apache.REEF.Utilities.Optional< T >.Of ( value)
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.

static Optional<T> Org.Apache.REEF.Utilities.Optional< T >.OfNullable ( value)
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.

T Org.Apache.REEF.Utilities.Optional< T >.OrElse ( other)
inline

Returns other if the current Optional<T> is empty.

override string Org.Apache.REEF.Utilities.Optional< T >.ToString ( )
inline

Property Documentation

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).


The documentation for this class was generated from the following file: