KlusterKite  0.0.0
A framework to create scalable and redundant services based on awesome Akka.Net project.
KlusterKite.Core.Monads.Maybe< T > Struct Template Reference

Generic helper to make typed nulls More...

Public Member Functions

 Maybe (T value)
 Initializes a new instance of the Maybe<T> structure. More...
 
bool Equals (Maybe< T > other)
 Equals for two wrappers More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 

Static Public Member Functions

static implicit operator Maybe< T > (T obj)
 Converts original object to wrapper More...
 
static implicit operator T (Maybe< T > obj)
 Converts wrapper to the original object More...
 
static bool operator!= (Maybe< T > left, Maybe< T > right)
 Not equals for two wrappers More...
 
static bool operator== (Maybe< T > left, Maybe< T > right)
 Equals for two wrappers More...
 

Public Attributes

bool HasValue => this.Value != null
 Gets a value indicating whether this is not a null More...
 

Properties

Value [get]
 Gets the value. More...
 

Detailed Description

Generic helper to make typed nulls

Template Parameters
TEnd type
Type Constraints
T :class 

Definition at line 18 of file Maybe.cs.

Constructor & Destructor Documentation

◆ Maybe()

Initializes a new instance of the Maybe<T> structure.

Parameters
valueThe value.

Definition at line 26 of file Maybe.cs.

Member Function Documentation

◆ Equals() [1/2]

bool KlusterKite.Core.Monads.Maybe< T >.Equals ( Maybe< T >  other)

Equals for two wrappers

Parameters
otherWrapper to compare
Returns
Whether these to wrappers are equal

Definition at line 89 of file Maybe.cs.

◆ Equals() [2/2]

override bool KlusterKite.Core.Monads.Maybe< T >.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Returns
true if obj and this instance are the same type and represent the same value; otherwise, false.
Parameters
objThe object to compare with the current instance.

Definition at line 111 of file Maybe.cs.

◆ GetHashCode()

override int KlusterKite.Core.Monads.Maybe< T >.GetHashCode ( )

Returns the hash code for this instance.

Returns
A 32-bit signed integer that is the hash code for this instance.

Definition at line 122 of file Maybe.cs.

◆ operator Maybe< T >()

static implicit KlusterKite.Core.Monads.Maybe< T >.operator Maybe< T > ( obj)
static

Converts original object to wrapper

Parameters
objThe original object

Definition at line 47 of file Maybe.cs.

◆ operator T()

static implicit KlusterKite.Core.Monads.Maybe< T >.operator T ( Maybe< T >  obj)
static

Converts wrapper to the original object

Parameters
objWrapped object

Definition at line 56 of file Maybe.cs.

◆ operator!=()

static bool KlusterKite.Core.Monads.Maybe< T >.operator!= ( Maybe< T >  left,
Maybe< T >  right 
)
static

Not equals for two wrappers

Parameters
leftLeft wrapper
rightRight wrapper
Returns
Whether these to wrappers are not equal

Definition at line 67 of file Maybe.cs.

◆ operator==()

static bool KlusterKite.Core.Monads.Maybe< T >.operator== ( Maybe< T >  left,
Maybe< T >  right 
)
static

Equals for two wrappers

Parameters
leftLeft wrapper
rightRight wrapper
Returns
Whether these to wrappers are equal

Definition at line 78 of file Maybe.cs.

Member Data Documentation

◆ HasValue

bool KlusterKite.Core.Monads.Maybe< T >.HasValue => this.Value != null

Gets a value indicating whether this is not a null

Definition at line 35 of file Maybe.cs.

Property Documentation

◆ Value

Gets the value.

Definition at line 41 of file Maybe.cs.


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