min
mach::FieldValidationBuilder::min
Adds minimum value validation.
Description
Section titled “Description”Applies a minimum value validation rule to a numeric field.
Syntax
Section titled “Syntax”template <typename Number>FieldValidationBuilder& min(Number minimum);Return Value
Section titled “Return Value”A reference to the current FieldValidationBuilder instance.
Template Parameters
Section titled “Template Parameters”| Parameter | Description |
|---|---|
Number |
The numeric type of the minimum value. |
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
minimum |
The minimum allowed value. |
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<Product>& validation) const { validation.field(&Product::price) .min(0);}See Also
Section titled “See Also”| Name | Description |
|---|---|
range |
Adds range validation. |
max |
Adds maximum value validation. |
multipleOf |
Adds multiple-of validation. |