public class DoubleRangeValidator extends CustomValidator<Double>
Modifier and Type | Method and Description |
---|---|
static DoubleRangeValidator |
atLeast(double min,
String errorMessage)
Creates a DoubleRangeValidator with a given lower bound.
|
static DoubleRangeValidator |
between(double min,
double max,
String errorMessage)
Creates a DoubleRangeValidator with given lower and upper bounds.
|
static DoubleRangeValidator |
exactly(double value,
String errorMessage)
Creates a DoubleRangeValidator with a given lower and upper bound, which
are equal.
|
static DoubleRangeValidator |
upTo(double max,
String errorMessage)
Creates a DoubleRangeValidator with a given upper bound.
|
forPredicate, validate
public static DoubleRangeValidator between(double min, double max, String errorMessage)
min
- The lower bound for the validation.max
- The upper bound for the validation.errorMessage
- The error message that is returned if the validation fails.IllegalArgumentException
- Thrown if the maximum is not larger than or equal to the
minimum.public static DoubleRangeValidator atLeast(double min, String errorMessage)
min
- The lower bound for the validation.errorMessage
- The error message that is returned if the validation fails.public static DoubleRangeValidator upTo(double max, String errorMessage)
max
- The upper bound for the validation.errorMessage
- The error message that is returned if the validation fails.public static DoubleRangeValidator exactly(double value, String errorMessage)
value
- The lower and upper bound for the validation.errorMessage
- The error message that is returned if the validation fails.Copyright © 2017. All rights reserved.