Table of Contents

Struct Optionable<T>

Namespace
Zorro.Core
Assembly
Zorro.Core.Runtime.dll
public readonly struct Optionable<T> : IEquatable<Optionable<T>> where T : struct

Type Parameters

T
Implements
Inherited Members
Extension Methods

Properties

IsNone

public bool IsNone { get; }

Property Value

bool

IsSome

public bool IsSome { get; }

Property Value

bool

None

public static Optionable<T> None { get; }

Property Value

Optionable<T>

Value

public T Value { get; }

Property Value

T

Methods

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(Optionable<T>)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Optionable<T> other)

Parameters

other Optionable<T>

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

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

NoneWithValue(T)

public static Optionable<T> NoneWithValue(T value)

Parameters

value T

Returns

Optionable<T>

Some(T)

public static Optionable<T> Some(T value)

Parameters

value T

Returns

Optionable<T>

ValueOr(T)

public T ValueOr(T other)

Parameters

other T

Returns

T

Operators

operator ==(Optionable<T>, Optionable<T>)

public static bool operator ==(Optionable<T> left, Optionable<T> right)

Parameters

left Optionable<T>
right Optionable<T>

Returns

bool

operator !=(Optionable<T>, Optionable<T>)

public static bool operator !=(Optionable<T> left, Optionable<T> right)

Parameters

left Optionable<T>
right Optionable<T>

Returns

bool