Table of Contents

Class IsNotInRangeValidator<T, TResult>

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

Represents a generic object validator that expects objects to not be in a specified range.

public sealed class IsNotInRangeValidator<T, TResult> : IValidator<T, TResult>

Type Parameters

T

Object type.

TResult

Result type.

Inheritance
IsNotInRangeValidator<T, TResult>
Implements
IValidator<T, TResult>
Inherited Members
Extension Methods

Constructors

IsNotInRangeValidator(T, T, IComparer<T>, TResult)

Creates a new IsNotInRangeValidator<T, TResult> instance.

public IsNotInRangeValidator(T min, T max, IComparer<T> comparer, TResult failureResult)

Parameters

min T

Minimum value to compare with.

max T

Maximum value to compare with.

comparer IComparer<T>

Value comparer.

failureResult TResult

Failure result.

Exceptions

ArgumentOutOfRangeException

When min is greater than max.

Properties

Comparer

Value comparer.

public IComparer<T> Comparer { get; }

Property Value

IComparer<T>

FailureResult

Failure result.

public TResult FailureResult { get; }

Property Value

TResult

Max

Maximum value to compare with.

public T Max { get; }

Property Value

T

Min

Minimum value to compare with.

public T Min { get; }

Property Value

T

Methods

Validate(T)

Validates the provided obj.

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

Parameters

obj T

Object to validate.

Returns

Chain<TResult>

Result of obj validation.