A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.IOptionMonad-1.html below:

Interface IOptionMonad<T> | .NEXT

Interface IOptionMonad<T>

Represents the common interface for all option monads.

Namespace: DotNext Assembly: DotNext.dll Syntax
public interface IOptionMonad<T> : ISupplier<object?>, IFunctional<Func<object?>>
Type Parameters Name Description T

The type of the value in the container.

Properties | Edit this page View Source HasValue

Indicates that this monad contains a value.

Declaration Property Value | Edit this page View Source ValueOrDefault

If a value is present, returns the value, otherwise return default value.

Declaration
T? ValueOrDefault { get; }
Property Value Type Description T

The value stored in the container, if present, otherwise, default value.

Methods | Edit this page View Source Or(T?)

Returns the value if present; otherwise return default value.

Declaration Parameters Type Name Description T defaultValue

The value to be returned if there is no value present.

Returns Type Description T

The value, if present, otherwise defaultValue.

| Edit this page View Source OrInvoke(Func<T>)

Returns the value if present; otherwise invoke delegate.

Declaration
T OrInvoke(Func<T> defaultFunc)
Parameters Type Name Description Func<T> defaultFunc

A delegate to be invoked if value is not present.

Returns Type Description T

The value, if present, otherwise returned from delegate.

| Edit this page View Source TryGet(out T)

Attempts to extract value from the container if it is present.

Declaration Parameters Type Name Description T value

Extracted value.

Returns Type Description bool

true if value is present; otherwise, false.

Extension Methods

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4