Table of Contents

Class IsInExclusiveRangeValidator<T, TResult>

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

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

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

Type Parameters

T

Object type.

TResult

Result type.

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

Constructors

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

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

Parameters

min T

Minimum exclusive value to compare with.

max T

Maximum exclusive 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 exclusive value to compare with.

public T Max { get; }

Property Value

T

Min

Minimum exclusive 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.