Equals Method
Definition
- Namespace
- Tyne
- Assembly
- Tyne.Core.dll
Methods
| Edit this page View SourceEquals(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
Returns
boolOverrides
Remarks
Equality is determined with the following logic:
- if
obj
is an Option<T>, then use Equals(in Option<T>) - if
obj
is aT
, then use Equals(T?) - true if
obj
is null, and this option does not have a value - otherwise; false
T
equality is determined via Default.
Equals(in Option<T>)
Declaration
[Pure]
public bool Equals(in Option<T> other)
Parameters
Returns
boolRemarks
Equality is determined with the following logic:
T
equality is determined via Default.
Equals(in Option<T>?)
Declaration
[Pure]
public bool Equals(in Option<T>? other)
Parameters
Returns
boolRemarks
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(
and theirT
)T
values are equal - otherwise; false
T
equality is determined via Default.
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.