Table of Contents

Struct ValidationState

Namespace
Visus.AddressValidation.Validation
Assembly
Visus.AddressValidation.dll

Defines a validation state

public readonly struct ValidationState : IEquatable<ValidationState>
Implements
Inherited Members

Properties

Message

Gets the human-readable message describing the validation issue.

public string Message { get; }

Property Value

string

Severity

Gets the severity level of this validation state.

public ValidationSeverity Severity { get; }

Property Value

ValidationSeverity

Methods

CreateError(string, params object[])

Creates an error validation with a given message.

public static ValidationState CreateError(string messageFormat, params object[] args)

Parameters

messageFormat string

A composite format string .

args object[]

An object array that contains zero or more objects to format.

Returns

ValidationState

ValidationState instance.

CreateError(string, string?)

Creates an error validation state with a given message (optionally associated with a property).

public static ValidationState CreateError(string message, string? propertyName = null)

Parameters

message string

The message associated with the validation state.

propertyName string

The name of the property associated with the validation state.

Returns

ValidationState

ValidationState instance.

CreateWarning(string, params object[])

Creates a warning validation state with a given message.

public static ValidationState CreateWarning(string messageFormat, params object[] args)

Parameters

messageFormat string

A composite format string .

args object[]

An object array that contains zero or more objects to format.

Returns

ValidationState

ValidationState instance.

CreateWarning(string, string?)

Creates a warning validation state with a given message (optionally associated with a property).

public static ValidationState CreateWarning(string message, string? propertyName = null)

Parameters

message string

The message associated with the validation state.

propertyName string

The name of the property associated with the validation state.

Returns

ValidationState

ValidationState instance.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(ValidationState)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ValidationState other)

Parameters

other ValidationState

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the validation state message.

public override string ToString()

Returns

string

The validation state message.

Operators

operator ==(ValidationState, ValidationState)

Indicates whether the values of the two specified ValidationState objects are equal.

public static bool operator ==(ValidationState left, ValidationState right)

Parameters

left ValidationState

The first object to compare.

right ValidationState

The second object to compare.

Returns

bool

true if left and right are equal; otherwise, false.

operator !=(ValidationState, ValidationState)

Indicates whether the values of the two specified ValidationState objects are not equal.

public static bool operator !=(ValidationState left, ValidationState right)

Parameters

left ValidationState

The first object to compare.

right ValidationState

The second object to compare.

Returns

bool

true if left and right are not equal; otherwise, false.