Table of Contents

Class Branch

Namespace
Executables
Assembly
executables.dll

Factory methods for creating conditional executors.

public static class Branch
Inheritance
Branch
Inherited Members

Methods

When<T>(Func<bool>, IExecutable<Unit, T>)

Creates a parameterless executor from an executable that runs only when the condition is satisfied.

[Pure]
public static IExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IExecutable<Unit, T> executable)

Parameters

condition Func<bool>

Condition that decides whether execution should proceed.

executable IExecutable<Unit, T>

Executable to run when the condition is satisfied.

Returns

IExecutor<Unit, Optional<T>>

Executor that returns an Optional<T> containing the result when executed.

Type Parameters

T

Exceptions

ArgumentNullException

condition or executable is null.

When<T>(Func<bool>, IExecutor<Unit, Optional<T>>)

Creates a parameterless executor that runs only when the condition is satisfied and flattens an optional result.

[Pure]
public static IExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IExecutor<Unit, Optional<T>> executor)

Parameters

condition Func<bool>

Condition that decides whether execution should proceed.

executor IExecutor<Unit, Optional<T>>

Executor to run when the condition is satisfied.

Returns

IExecutor<Unit, Optional<T>>

Executor that returns the inner optional result when executed.

Type Parameters

T

Exceptions

ArgumentNullException

condition or executor is null.

When<T>(Func<bool>, IExecutor<Unit, T>)

Creates a parameterless executor that runs only when the condition is satisfied.

[Pure]
public static IExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IExecutor<Unit, T> executor)

Parameters

condition Func<bool>

Condition that decides whether execution should proceed.

executor IExecutor<Unit, T>

Executor to run when the condition is satisfied.

Returns

IExecutor<Unit, Optional<T>>

Executor that returns an Optional<T> containing the result when executed.

Type Parameters

T

Exceptions

ArgumentNullException

condition or executor is null.

When<T1, T2>(Func<T1, bool>, IExecutable<T1, T2>)

Creates an executor from an executable that runs only when the condition is satisfied.

[Pure]
public static IExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IExecutable<T1, T2> executable)

Parameters

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executable IExecutable<T1, T2>

Executable to run when the condition is satisfied.

Returns

IExecutor<T1, Optional<T2>>

Executor that returns an Optional<T> containing the result when executed.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or executable is null.

When<T1, T2>(Func<T1, bool>, IExecutor<T1, Optional<T2>>)

Creates an executor that runs only when the condition is satisfied and flattens an optional result.

[Pure]
public static IExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IExecutor<T1, Optional<T2>> executor)

Parameters

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executor IExecutor<T1, Optional<T2>>

Executor to run when the condition is satisfied.

Returns

IExecutor<T1, Optional<T2>>

Executor that returns the inner optional result when executed.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or executor is null.

When<T1, T2>(Func<T1, bool>, IExecutor<T1, T2>)

Creates an executor that runs only when the condition is satisfied.

[Pure]
public static IExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IExecutor<T1, T2> executor)

Parameters

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executor IExecutor<T1, T2>

Executor to run when the condition is satisfied.

Returns

IExecutor<T1, Optional<T2>>

Executor that returns an Optional<T> containing the result when executed.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or executor is null.