Validate the given object against the constraint.
if (minValue > value) {
throw new ConstraintException(ConstraintExceptionType.VALUE_BELOW_MINIMUM);
}
if (maxValue < value) {
throw new ConstraintException(ConstraintExceptionType.VALUE_ABOVE_MAXIMUM);
}