Class NumericConstraints
- java.lang.Object
-
- net.sourceforge.pmd.properties.constraints.NumericConstraints
-
public final class NumericConstraints extends Object
Common constraints for properties dealing with numbers.- Since:
- 6.10.0
- Author:
- Clément Fournier
- See Also:
PropertyConstraint
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <N extends Number & Comparable<N>>
PropertyConstraint<N>inRange(N minInclusive, N maxInclusive)
Requires the number to be inside a range.static <N extends Number>
PropertyConstraint<N>positive()
Requires the number to be strictly positive.
-
-
-
Method Detail
-
inRange
public static <N extends Number & Comparable<N>> PropertyConstraint<N> inRange(N minInclusive, N maxInclusive)
Requires the number to be inside a range.- Type Parameters:
N
- Type of number- Returns:
- A range constraint
-
positive
public static <N extends Number> PropertyConstraint<N> positive()
Requires the number to be strictly positive. The int values of the number is used for comparison so there may be some unexpected behaviour with decimal numbers.- Type Parameters:
N
- Type of number- Returns:
- A positivity constraint
-
-