Click or drag to resize

MaybeT Class

Inheritance Hierarchy
SystemObject
  TomsToolbox.CoreMaybeT

Namespace:  TomsToolbox.Core
Assembly:  TomsToolbox.Core (in TomsToolbox.Core.dll) Version: 1.0.68.0
Syntax
public class Maybe<T>
where T : class

Type Parameters

T

The MaybeT type exposes the following members.

Constructors
  NameDescription
Public methodMaybeT
Initializes a new instance of the MaybeT class.
Top
Methods
  NameDescription
Public methodDo
Executes the specified action if the inner value is not null.

[NotNull]

Public methodIf
Checks the condition and returns an empty Maybe if the condition fails.

[NotNull]

Public methodReturn(T)
Returns the if the inner value if not null, else returns the default value.

[CanBeNull]

Public methodReturnTTarget(FuncT, TTarget)
Returns the value extracted from the specified selector if the inner value is not null, else returns default(TTarget).

[CanBeNull]

Public methodReturnTTarget(FuncT, TTarget, TTarget)
Returns the value extracted from the specified selector if the inner value is not null, else returns the default value.

[CanBeNull]

Public methodSelectTTarget
Returns a new MaybeT for the target.

[NotNull]

Public methodUnless
Checks the condition and returns an empty Maybe if the condition succeeds.

[NotNull]

Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
See Also