Class RuleOption<TFirst, TSecond>
Represents the union of two types, TFirst
and TSecond
.
Used to represent a rule with multiple return states
Inherited Members
Namespace: OpenSearch.Net.VirtualizedCluster.Rules
Assembly: OpenSearch.Net.VirtualizedCluster.dll
Syntax
public class RuleOption<TFirst, TSecond>
Type Parameters
Name | Description |
---|---|
TFirst | The first type |
TSecond | The second type |
Constructors
| Edit this page View SourceRuleOption(TFirst)
Creates an new instance of RuleOption<TFirst, TSecond> that encapsulates item
value
Declaration
public RuleOption(TFirst item)
Parameters
Type | Name | Description |
---|---|---|
TFirst | item | The value to encapsulate |
RuleOption(TSecond)
Creates an new instance of RuleOption<TFirst, TSecond> that encapsulates item
value
Declaration
public RuleOption(TSecond item)
Parameters
Type | Name | Description |
---|---|---|
TSecond | item | The value to encapsulate |
Methods
| Edit this page View SourceMatch(Action<TFirst>, Action<TSecond>)
Runs an Action<T> delegate against the encapsulated value
Declaration
public void Match(Action<TFirst> first, Action<TSecond> second)
Parameters
Type | Name | Description |
---|---|---|
Action<TFirst> | first | The delegate to run when this instance encapsulates an instance of |
Action<TSecond> | second | The delegate to run when this instance encapsulates an instance of |
Match<T>(Func<TFirst, T>, Func<TSecond, T>)
Runs a Func<T, TResult> delegate against the encapsulated value
Declaration
public T Match<T>(Func<TFirst, T> first, Func<TSecond, T> second)
Parameters
Type | Name | Description |
---|---|---|
Func<TFirst, T> | first | The delegate to run when this instance encapsulates an instance of |
Func<TSecond, T> | second | The delegate to run when this instance encapsulates an instance of |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Operators
| Edit this page View Sourceimplicit operator RuleOption<TFirst, TSecond>(TFirst)
Declaration
public static implicit operator RuleOption<TFirst, TSecond>(TFirst first)
Parameters
Type | Name | Description |
---|---|---|
TFirst | first |
Returns
Type | Description |
---|---|
RuleOption<TFirst, TSecond> |
implicit operator RuleOption<TFirst, TSecond>(TSecond)
Declaration
public static implicit operator RuleOption<TFirst, TSecond>(TSecond second)
Parameters
Type | Name | Description |
---|---|---|
TSecond | second |
Returns
Type | Description |
---|---|
RuleOption<TFirst, TSecond> |