Show / Hide Table of Contents

Class CommandInterpreter.Builder

Represents builder of the interpreter.

Inheritance
object
CommandInterpreter.Builder
Implements
ISupplier<CommandInterpreter>
IFunctional
IResettable
Inherited Members
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Net.Cluster.Consensus.Raft.Commands
Assembly: DotNext.Net.Cluster.dll
Syntax
public sealed class CommandInterpreter.Builder : ISupplier<CommandInterpreter>, IFunctional, IResettable

Constructors

View Source

Builder()

Declaration
public Builder()

Methods

View Source

Add<TCommand>(Func<TCommand, object?, CancellationToken, ValueTask>)

Registers command handler.

Declaration
public CommandInterpreter.Builder Add<TCommand>(Func<TCommand, object?, CancellationToken, ValueTask> handler) where TCommand : ICommand<TCommand>
Parameters
Type Name Description
Func<TCommand, object, CancellationToken, ValueTask> handler

The command handler.

Returns
Type Description
CommandInterpreter.Builder

This builder.

Type Parameters
Name Description
TCommand

The type of the command supported by the handler.

Exceptions
Type Condition
ArgumentNullException

handler is null.

View Source

Add<TCommand>(Func<TCommand, CancellationToken, ValueTask>)

Registers command handler.

Declaration
public CommandInterpreter.Builder Add<TCommand>(Func<TCommand, CancellationToken, ValueTask> handler) where TCommand : ICommand<TCommand>
Parameters
Type Name Description
Func<TCommand, CancellationToken, ValueTask> handler

The command handler.

Returns
Type Description
CommandInterpreter.Builder

This builder.

Type Parameters
Name Description
TCommand

The type of the command supported by the handler.

Exceptions
Type Condition
ArgumentNullException

handler is null.

View Source

Build()

Constructs an instance of CommandInterpreter.

Declaration
public CommandInterpreter Build()
Returns
Type Description
CommandInterpreter

A new instance of the interpreter.

View Source

Reset()

Clears this builder so it can be reused.

Declaration
public void Reset()

Implements

ISupplier<TResult>
IFunctional
IResettable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾