Skip to content

Simplify JavaIntegerConstraint structure to align with decimal constraint improvements #1153

Description

@Seol-JY

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

  1. Modify JavaIntegerConstraint to use a simplified constructor:
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions