Maybe wraps another type and is used to signal to other code that it might not return a result. It performs the same function as null, but in a more type-safe manner that provides more clarity into the contract that function exhibits.
More...
|
| Maybe (T value) |
| Creates a new Maybe container that holds the given value. More...
|
|
override string | ToString () |
|
|
T | Value [get] |
| Gets the underlying value. More...
|
|
bool | Exists [get] |
| Returns true if this Maybe has a value stored in it. More...
|
|
bool | IsEmpty [get] |
| Returns true if this Maybe is empty, it, it does not have a value stored in it. More...
|
|
Maybe wraps another type and is used to signal to other code that it might not return a result. It performs the same function as null, but in a more type-safe manner that provides more clarity into the contract that function exhibits.
- Template Parameters
-
T | The type of value stored in the Maybe instance |
Forge.Utilities.Maybe< T >.Maybe |
( |
T |
value | ) |
|
Creates a new Maybe container that holds the given value.
readonly Maybe<T> Forge.Utilities.Maybe< T >.Empty = new Maybe<T>(default(T), false) |
|
static |
bool Forge.Utilities.Maybe< T >.Exists |
|
get |
Returns true if this Maybe has a value stored in it.
bool Forge.Utilities.Maybe< T >.IsEmpty |
|
get |
Returns true if this Maybe is empty, it, it does not have a value stored in it.
T Forge.Utilities.Maybe< T >.Value |
|
get |
Gets the underlying value.
If IsEmpty returns true, then this method will throw an InvalidOperationException.
The documentation for this struct was generated from the following file: