'Validate 1 field min and max based on another field value using JSR303 Validation
I have 2 fields
Class AgeDTO{
@Min(0)
private int minAge;
@Max(2)
private int maxAge;
private AgeType ageGroup;
}
How to validate minAge and maxAge based on ageGroup values as per below limits?
Age and Group
Age can be 0-2 for the infant group Age can be 2-12 for the youngster group Age can be 13-17 for the teen group Age can be 18-59 for adults
How can I write validation for these 2 field combinations in java?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
