Class IsEqualToValidator<T, TResult>
- Namespace
- LfrlAnvil.Validation.Validators
- Assembly
- LfrlAnvil.Validation.dll
Represents a generic object validator that expects objects to be equal to a specific value.
public sealed class IsEqualToValidator<T, TResult> : IValidator<T, TResult>
Type Parameters
T
Object type.
TResult
Result type.
- Inheritance
-
IsEqualToValidator<T, TResult>
- Implements
-
IValidator<T, TResult>
- Inherited Members
- Extension Methods
Constructors
IsEqualToValidator(T, IEqualityComparer<T>, TResult)
Creates a new IsEqualToValidator<T, TResult> instance.
public IsEqualToValidator(T determinant, IEqualityComparer<T> comparer, TResult failureResult)
Parameters
determinant
TValue to compare with.
comparer
IEqualityComparer<T>Value equality comparer.
failureResult
TResultFailure result.
Properties
Comparer
Value equality comparer.
public IEqualityComparer<T> Comparer { get; }
Property Value
Determinant
Value to compare with.
public T Determinant { get; }
Property Value
- T
FailureResult
Failure result.
public TResult FailureResult { get; }
Property Value
- TResult
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.