Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 202 additions & 0 deletions src/libs/Weave/Generated/Weave.AnyOf.10.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ namespace Weave
#endif
public bool IsValue1 => Value1 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T1? value)
{
value = Value1;
return IsValue1;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Weave
#endif
public bool IsValue2 => Value2 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T2? value)
{
value = Value2;
return IsValue2;
}

/// <summary>
///
/// </summary>
Expand All @@ -59,6 +85,19 @@ namespace Weave
#endif
public bool IsValue3 => Value3 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue3(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T3? value)
{
value = Value3;
return IsValue3;
}

/// <summary>
///
/// </summary>
Expand All @@ -76,6 +115,19 @@ namespace Weave
#endif
public bool IsValue4 => Value4 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue4(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T4? value)
{
value = Value4;
return IsValue4;
}

/// <summary>
///
/// </summary>
Expand All @@ -93,6 +145,19 @@ namespace Weave
#endif
public bool IsValue5 => Value5 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue5(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T5? value)
{
value = Value5;
return IsValue5;
}

/// <summary>
///
/// </summary>
Expand All @@ -110,6 +175,19 @@ namespace Weave
#endif
public bool IsValue6 => Value6 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue6(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T6? value)
{
value = Value6;
return IsValue6;
}

/// <summary>
///
/// </summary>
Expand All @@ -127,6 +205,19 @@ namespace Weave
#endif
public bool IsValue7 => Value7 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue7(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T7? value)
{
value = Value7;
return IsValue7;
}

/// <summary>
///
/// </summary>
Expand All @@ -144,6 +235,19 @@ namespace Weave
#endif
public bool IsValue8 => Value8 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue8(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T8? value)
{
value = Value8;
return IsValue8;
}

/// <summary>
///
/// </summary>
Expand All @@ -161,6 +265,19 @@ namespace Weave
#endif
public bool IsValue9 => Value9 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue9(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T9? value)
{
value = Value9;
return IsValue9;
}

/// <summary>
///
/// </summary>
Expand All @@ -177,6 +294,19 @@ namespace Weave
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value10))]
#endif
public bool IsValue10 => Value10 != null;

/// <summary>
///
/// </summary>
public bool TryPickValue10(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out T10? value)
{
value = Value10;
return IsValue10;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -495,6 +625,78 @@ public bool Validate()
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,

global::System.Action<T2>? value2 = null,

global::System.Action<T3>? value3 = null,

global::System.Action<T4>? value4 = null,

global::System.Action<T5>? value5 = null,

global::System.Action<T6>? value6 = null,

global::System.Action<T7>? value7 = null,

global::System.Action<T8>? value8 = null,

global::System.Action<T9>? value9 = null,

global::System.Action<T10>? value10 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1)
{
value1?.Invoke(Value1!);
}
else if (IsValue2)
{
value2?.Invoke(Value2!);
}
else if (IsValue3)
{
value3?.Invoke(Value3!);
}
else if (IsValue4)
{
value4?.Invoke(Value4!);
}
else if (IsValue5)
{
value5?.Invoke(Value5!);
}
else if (IsValue6)
{
value6?.Invoke(Value6!);
}
else if (IsValue7)
{
value7?.Invoke(Value7!);
}
else if (IsValue8)
{
value8?.Invoke(Value8!);
}
else if (IsValue9)
{
value9?.Invoke(Value9!);
}
else if (IsValue10)
{
value10?.Invoke(Value10!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
global::System.Action<T3>? value3 = null,
global::System.Action<T4>? value4 = null,
Expand Down
Loading