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
Severity
Gets the severity level of this validation state.
public ValidationSeverity Severity { get; }
Property Value
Methods
CreateError(string, params object[])
Creates an error validation with a given message.
public static ValidationState CreateError(string messageFormat, params object[] args)
Parameters
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
messagestringThe message associated with the validation state.
propertyNamestringThe 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
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
messagestringThe message associated with the validation state.
propertyNamestringThe 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherValidationStateAn object to compare with this object.
Returns
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
leftValidationStateThe first object to compare.
rightValidationStateThe second object to compare.
Returns
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
leftValidationStateThe first object to compare.
rightValidationStateThe second object to compare.