Report thresholds for metrics for example usually only have the constraint that they must be positive. It makes no sense to artificially restrict that, and it obliges us to take an arbitrary decision ("is 2000 enough? should I add a zero?"). We could add some methods mustBeAbove and mustBeBelow to the property builders and implement some logic in the NumericPropertyModule to have unbounded intervals.
- When defining a property programmatically, one can use
NumericConstraint.positive()
- But when defining a property in XML, you always have to provide
min and max:
<property name="intProp" type="Integer" value="3" min="1" max="20" description="An IntegerProperty."/>
- this will always build a range constraint
Report thresholds for metrics for example usually only have the constraint that they must be positive. It makes no sense to artificially restrict that, and it obliges us to take an arbitrary decision ("is 2000 enough? should I add a zero?"). We could add some methods
mustBeAboveandmustBeBelowto the property builders and implement some logic in the NumericPropertyModule to have unbounded intervals.NumericConstraint.positive()minandmax: