Struct Optional<T>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Assembly: Discord.Net.Core.dll
Syntax
public struct Optional<T>
Type Parameters
Constructors
|
Improve this Doc
View Source
Optional(T)
Creates a new Parameter with the provided value.
Declaration
Parameters
| Type |
Name |
Description |
| T |
value |
|
Properties
|
Improve this Doc
View Source
IsSpecified
Returns true if this value has been specified.
Declaration
public bool IsSpecified { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Unspecified
Declaration
public static Optional<T> Unspecified { get; }
Property Value
|
Improve this Doc
View Source
Value
Gets the value for this parameter.
Declaration
Property Value
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
This property has no value set.
|
Methods
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
| Type |
Name |
Description |
| System.Object |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
GetValueOrDefault()
Declaration
public T GetValueOrDefault()
Returns
|
Improve this Doc
View Source
GetValueOrDefault(T)
Declaration
public T GetValueOrDefault(T defaultValue)
Parameters
| Type |
Name |
Description |
| T |
defaultValue |
|
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.ValueType.ToString()
Operators
|
Improve this Doc
View Source
Explicit(Optional<T> to T)
Declaration
public static explicit operator T(Optional<T> value)
Parameters
Returns
|
Improve this Doc
View Source
Implicit(T to Optional<T>)
Declaration
public static implicit operator Optional<T>(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns