Table of Contents

Class IsLengthExactValidator<TResult>

Namespace
LfrlAnvil.Validation.Validators
Assembly
LfrlAnvil.Validation.dll

Represents a string validator that expects an exact Length.

public sealed class IsLengthExactValidator<TResult> : IValidator<string, TResult>

Type Parameters

TResult

Result type.

Inheritance
IsLengthExactValidator<TResult>
Implements
IValidator<string, TResult>
Inherited Members
Extension Methods

Constructors

IsLengthExactValidator(int, TResult)

Creates a new IsLengthExactValidator<TResult> instance.

public IsLengthExactValidator(int length, TResult failureResult)

Parameters

length int

Expected exact Length.

failureResult TResult

Failure result.

Exceptions

ArgumentOutOfRangeException

When length is less than 0.

Properties

FailureResult

Failure result.

public TResult FailureResult { get; }

Property Value

TResult

Length

Expected exact Length.

public int Length { get; }

Property Value

int

Methods

Validate(string)

Validates the provided obj.

[Pure]
public Chain<TResult> Validate(string obj)

Parameters

obj string

Object to validate.

Returns

Chain<TResult>

Result of obj validation.