Table of Contents

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 T

Value to compare with.

comparer IEqualityComparer<T>

Value equality comparer.

failureResult TResult

Failure result.

Properties

Comparer

Value equality comparer.

public IEqualityComparer<T> Comparer { get; }

Property Value

IEqualityComparer<T>

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 T

Object to validate.

Returns

Chain<TResult>

Result of obj validation.