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, wait
and
public 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.Validator
validate
in interface Field.Validator
config
- 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 © 2017 JBoss by Red Hat. All rights reserved.