Table of Contents

Equals Method

Definition

Namespace
Tyne
Assembly
Tyne.Core.dll

Methods

| Edit this page View Source

Equals(object?)

Determines whether the specified obj is an Option<T>, and if so is equal to the current instance.

Declaration
[Pure]
public override bool Equals(object? obj)
Parameters
obj
object

An object to compare with this instance.

Returns
bool

true if the specified obj is an Option<T>, and is equal to this instance; otherwise, false.

Overrides
Remarks

Equality is determined with the following logic:

T equality is determined via Default.

| Edit this page View Source

Equals(in Option<T>)

Determines whether the specified Option<T> other is equal to the current instance of Option<T>.

Declaration
[Pure]
public bool Equals(in Option<T> other)
Parameters
other
Option<T>

The other Option<T> to compare with this instance.

Returns
bool

true if the specified other is equal to this instance; otherwise, false.

Remarks

Equality is determined with the following logic:

  • true if both are None()
  • true if both are Some(T) and their T values are equal
  • otherwise; false

T equality is determined via Default.

| Edit this page View Source

Equals(in Option<T>?)

Determines whether the specified Option<T> other is equal to the current instance of Option<T>.

Declaration
[Pure]
public bool Equals(in Option<T>? other)
Parameters
other
Option<T>?

The other Option<T> to compare with this instance.

Returns
bool

true if the specified other is equal to this instance; otherwise, false.

Remarks

Equality is determined with the following logic:

  • true if both are None()
  • true if one is None(), and the other is null
  • true if both are Some(T) and their T values are equal
  • otherwise; false

T equality is determined via Default.

| Edit this page View Source

Equals(T?)

Determines whether the specified T other is equal to the current instance of Option<T>.

Declaration
[Pure]
public bool Equals(T? other)
Parameters
other
T

The other T to compare with this instance.

Returns
bool

true if the specified other is equal to this instance; otherwise, false.

Remarks

Equality is determined with the following logic:

  • true if this is None() and other is null
  • true if this is Some(T) whose T values equals other
  • otherwise; false

T equality is determined via Default.