SumType<T1,T2,T3,T4> Struct

Definition

Struct that may contain a T1, a T2, a T3, or a T4.

generic <typename T1, typename T2, typename T3, typename T4>
public value class SumType : IEquatable<Microsoft::VisualStudio::LanguageServer::Protocol::SumType<T1, T2, T3, T4>>, Microsoft::VisualStudio::LanguageServer::Protocol::ISumType
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.LanguageServer.Protocol.SumConverter))]
public struct SumType<T1,T2,T3,T4> : IEquatable<Microsoft.VisualStudio.LanguageServer.Protocol.SumType<T1,T2,T3,T4>>, Microsoft.VisualStudio.LanguageServer.Protocol.ISumType
[<Newtonsoft.Json.JsonConverter(typeof(Microsoft.VisualStudio.LanguageServer.Protocol.SumConverter))>]
type SumType<'T1, 'T2, 'T3, 'T4> = struct
    interface ISumType
Public Structure SumType(Of T1, T2, T3, T4)
Implements IEquatable(Of SumType(Of T1, T2, T3, T4)), ISumType

Type Parameters

T1

The first type this struct is designed to contain.

T2

The second type this struct is designed to contain.

T3

The third type this struct is designed to contain.

T4

The fourth type this struct is designed to contain.

Inheritance
SumType<T1,T2,T3,T4>
Attributes
Newtonsoft.Json.JsonConverterAttribute
Implements
ISumType IEquatable<SumType<T1,T2,T3,T4>>

Constructors

SumType<T1,T2,T3,T4>(T1)

Initializes a new instance of the SumType<T1,T2,T3,T4> struct containing a T1.

SumType<T1,T2,T3,T4>(T2)

Initializes a new instance of the SumType<T1,T2,T3,T4> struct containing a T2.

SumType<T1,T2,T3,T4>(T3)

Initializes a new instance of the SumType<T1,T2,T3,T4> struct containing a T3.

SumType<T1,T2,T3,T4>(T4)

Initializes a new instance of the SumType<T1,T2,T3,T4> struct containing a T4.

Properties

First

Gets the value as the first specified type.

Fourth

Gets the value as the fourth specified type.

Second

Gets the value as the second specified type.

Third

Gets the value as the third specified type.

Value

Gets the value stored in the SumType. This can be matched against using the "is" operator.

Methods

Equals(Object)

Indicates whether this instance and a specified object are equal.

Equals(SumType<T1,T2,T3,T4>)

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

GetHashCode()

Returns the hash code for this instance.

Match<TResult>(Func<T1,TResult>, Func<T2,TResult>, Func<T3,TResult>, Func<T4,TResult>, Func<TResult>)

Runs a delegate corresponding to which type is contained inside this instance.

TryGetFirst(T1)

Tries to get the value as the first specified type.

TryGetFourth(T4)

Tries to get the value as the fourth specified type.

TryGetSecond(T2)

Tries to get the value as the second specified type.

TryGetThird(T3)

Tries to get the value as the third specified type.

Operators

Equality(SumType<T1,T2,T3,T4>, SumType<T1,T2,T3,T4>)
Explicit(SumType<T1,T2,T3,T4> to SumType<T1,T2,T3>)
Explicit(SumType<T1,T2,T3,T4> to SumType<T1,T2>)
Explicit(SumType<T1,T2,T3,T4> to T1)

Attempts to cast an instance of SumType<T1,T2,T3,T4> to an instance of T1.

Explicit(SumType<T1,T2,T3,T4> to T2)

Attempts to cast an instance of SumType<T1,T2,T3,T4> to an instance of T2.

Explicit(SumType<T1,T2,T3,T4> to T3)

Attempts to cast an instance of SumType<T1,T2,T3,T4> to an instance of T3.

Explicit(SumType<T1,T2,T3,T4> to T4)

Attempts to cast an instance of SumType<T1,T2,T3,T4> to an instance of T4.

Implicit(SumType<T1,T2,T3> to SumType<T1,T2,T3,T4>)
Implicit(SumType<T1,T2> to SumType<T1,T2,T3,T4>)
Implicit(T1 to Nullable<SumType<T1,T2,T3,T4>>)
Implicit(T1 to SumType<T1,T2,T3,T4>)
Implicit(T2 to Nullable<SumType<T1,T2,T3,T4>>)
Implicit(T2 to SumType<T1,T2,T3,T4>)
Implicit(T3 to Nullable<SumType<T1,T2,T3,T4>>)
Implicit(T3 to SumType<T1,T2,T3,T4>)
Implicit(T4 to Nullable<SumType<T1,T2,T3,T4>>)
Implicit(T4 to SumType<T1,T2,T3,T4>)
Inequality(SumType<T1,T2,T3,T4>, SumType<T1,T2,T3,T4>)

Applies to