Annotation Interface RangeConstraint
Constrains an element's numeric value to within a certain range.
May be used to annotate any field with a numeric type, such as int, long and double.
Notice that constraints given by the Java type take precedence over this annotation. So, even though it wouldn't
be an error to annotate a int field with @RangeConstraint(max = 10_000_000_000D) , the maximum
value the field could take would still be restricted by int's maximum value of 2_147_483_647.
Note: to constrain the size of the numeric values in a List<?> or Optional<?>,
annotate the type parameter as follows: List<@RangeConstraint Integer> or
Optional<@RangeConstraint Integer>.
-
Optional Element Summary
Optional Elements -
Field Summary
Fields
-
Field Details
-
MIN_DEFAULT
static final double MIN_DEFAULT- See Also:
-
MAX_DEFAULT
static final double MAX_DEFAULT- See Also:
-
-
Element Details
-
min
double min- Returns:
- minimum allowed magnitude for the annotated element.
- Default:
- -1.7976931348623157E308
-
max
double max- Returns:
- maximum allowed magnitude for the annotated element.
- Default:
- 1.7976931348623157E308
-