IntelligenceX
Struct

OptionalValue`1

Namespace IntelligenceX.Utils
Assembly IntelligenceX
Base ValueType
Modifiers sealed

Represents an optional value with explicit "specified" state.

Inheritance

  • ValueType
  • OptionalValue`1

Type Parameters

T

Constructors

public OptionalValue<T>(Boolean isSpecified, T value) #

Initializes a new optional value.

Parameters

isSpecified System.Boolean
Whether the value is specified.
value `0
The value when specified.

Methods

public static OptionalValue<T> FromValue(T value) #
Returns: OptionalValue<T>

Returns a specified optional value with the provided payload.

Parameters

value `0

Properties

public Boolean IsSpecified { get; } #

Gets a value indicating whether the value is specified.

public T Value { get; } #

Gets the underlying value when specified.

public static OptionalValue<T> Unspecified { get; } #

Returns an unspecified optional value.