Table of Contents

Class IsLengthInRangeValidator<TResult>

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

Represents a string validator that expects Length between a given range.

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

Type Parameters

TResult

Result type.

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

Constructors

IsLengthInRangeValidator(int, int, TResult)

Creates a new IsLengthInRangeValidator<TResult> instance.

public IsLengthInRangeValidator(int minLength, int maxLength, TResult failureResult)

Parameters

minLength int

Minimum expected Length.

maxLength int

Maximum expected Length.

failureResult TResult

Failure result.

Exceptions

ArgumentOutOfRangeException

When minLength is not in [0, maxLength] range.

Properties

FailureResult

Failure result.

public TResult FailureResult { get; }

Property Value

TResult

MaxLength

Maximum expected Length.

public int MaxLength { get; }

Property Value

int

MinLength

Minimum expected Length.

public int MinLength { 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.