| Total Complexity | 4 |
| Total Lines | 8 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package easytests.common.validators; |
||
| 9 | public abstract class AbstractDtoValidator extends AbstractValidator { |
||
| 10 | protected void validateIdEquals(Errors errors, Integer origin, Integer compare) { |
||
| 11 | this.validateEquals(errors, "id", origin, compare, "Id must be equal"); |
||
| 12 | } |
||
| 13 | |||
| 14 | protected void validateEquals(Errors errors, String fieldName, Integer origin, Integer compare, String message) { |
||
| 15 | if (((origin == null) && (compare != null)) || ((origin != null) && !origin.equals(compare))) { |
||
| 16 | reject(errors, fieldName, message); |
||
| 17 | } |
||
| 20 |