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)
Creates a new IsInExclusiveRangeValidator<T, TResult> instance.
public IsInExclusiveRangeValidator(T min, T max, IComparer<T> comparer, TResult failureResult)
Parameters
min
TMinimum exclusive value to compare with.
max
TMaximum exclusive value to compare with.
comparer
IComparer<T>Value comparer.
failureResult
TResultFailure result.
Exceptions
- ArgumentOutOfRangeException
When
min
is greater thanmax
.
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
TObject to validate.
Returns
- Chain<TResult>
Result of
obj
validation.