Describe the feature you request
Following the recent improvements in decimal validation (#1131), if there are no specific reasons for maintaining separate ranges, we should similarly simplify the JavaIntegerConstraint structure to align with our decimal constraint implementation.
Currently, it maintains separate ranges for positive and negative values (positiveMin, positiveMax, negativeMin, negativeMax), which adds unnecessary complexity.
Since Jakarta Validation annotations do not require handling discontinuous ranges (like -5~-3 AND 3~5), we can simplify this to use a single min/max range.
This would:
- Reduce code complexity
- Improve maintainability
- Make the integer constraint handling consistent with our decimal constraint implementation
- Maintain full compatibility with all Jakarta Validation annotations (
@Min, @Max, @Positive, @Negative, etc.)
(Optional): Suggest A Solution
- Modify
JavaIntegerConstraint to use a simplified constructor:
- Update the generateIntegerConstraint method to:
- Remove separate positive/negative range handling
- Consolidate constraint processing to maintain a single valid range
- Preserve all current Jakarta Validation annotation support
- Align implementation style with the recent decimal validation improvements
If the feature request is approved, would you be willing to submit a PR?
Yes
Describe the feature you request
Following the recent improvements in decimal validation (#1131), if there are no specific reasons for maintaining separate ranges, we should similarly simplify the
JavaIntegerConstraintstructure to align with our decimal constraint implementation.Currently, it maintains separate ranges for positive and negative values (positiveMin, positiveMax, negativeMin, negativeMax), which adds unnecessary complexity.
Since Jakarta Validation annotations do not require handling discontinuous ranges (like -5~-3 AND 3~5), we can simplify this to use a single min/max range.
This would:
@Min,@Max,@Positive,@Negative, etc.)(Optional): Suggest A Solution
JavaIntegerConstraintto use a simplified constructor:If the feature request is approved, would you be willing to submit a PR?
Yes