public static class Field.RangeValidator extends Object implements Field.Validator
| Modifier | Constructor and Description |
|---|---|
private |
RangeValidator(Number min,
Number max) |
| Modifier and Type | Method and Description |
|---|---|
static Field.RangeValidator |
atLeast(Number min)
A validator that checks only the lower numerical bound.
|
static Field.RangeValidator |
between(Number min,
Number max)
A validator that checks both the upper and lower bound.
|
void |
ensureValid(String name,
Object o) |
String |
toString() |
int |
validate(Configuration config,
Field field,
Field.ValidationOutput problems)
Validate the supplied value for the field, and report any problems to the designated consumer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitandpublic static Field.RangeValidator atLeast(Number min)
min - the minimum acceptable value; may not be nullpublic static Field.RangeValidator between(Number min, Number max)
min - the minimum acceptable value; may not be nullmax - the maximum acceptable value; may not be nullpublic int validate(Configuration config, Field field, Field.ValidationOutput problems)
Field.Validatorvalidate in interface Field.Validatorconfig - the configuration containing the field to be validated; may not be nullfield - the Field being validated; never nullproblems - the consumer to be called with each problem; never nullCopyright © 2021 JBoss by Red Hat. All rights reserved.