max = (Comparable) result;
}
if (min != null && max != null) {
if (decimal.compareTo(min) < 0 || decimal.compareTo(max) > 0) {
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.numeric.range",
new String[]{min.toString(), max.toString()},
Constants.I18N_CATALOGUE));
}
return null;
} else if (min != null) {
if (decimal.compareTo(min) < 0) {
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.numeric.min",
new String[]{min.toString()},
Constants.I18N_CATALOGUE));
}
return null;
} else if (max != null) {
if (decimal.compareTo(max) > 0) {
return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.numeric.max",
new String[]{max.toString()},
Constants.I18N_CATALOGUE));
}
return null;
}