notEquals
mach::FieldValidationBuilder::notEquals
Adds inequality validation.
Description
Section titled “Description”Applies an inequality validation rule to a field.
Syntax
Section titled “Syntax”template <typename U>FieldValidationBuilder& notEquals(U&& value);Return Value
Section titled “Return Value”A reference to the current FieldValidationBuilder instance.
Template Parameters
Section titled “Template Parameters”| Parameter | Description |
|---|---|
U |
A type from which the field type can be constructed. |
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
value |
The value the field must not equal. |
Remarks
Section titled “Remarks”Applying the same validation rule multiple times is allowed.
Thread Safety
Section titled “Thread Safety”This method is not thread-safe and should only be called during validation configuration.
Example
Section titled “Example”void validate(mach::ValidationBuilder<User>& validation) const { validation.field(&User::role) .notEquals("guest");}See Also
Section titled “See Also”| Name | Description |
|---|---|
equals |
Adds equality validation. |