class NotNegativeCoordinatesValidator implements ConstraintValidator<NotNegativeCoordinates, RectangularBox> {

    @Override
    public boolean isValid(RectangularBox value, ConstraintValidatorContext context) {
        if (value != null) {
            return value.getBottom() >= 0 && value.getTop() >= 0 && value.getLeft() >= 0 && value.getRight() >= 0;
        }
        return true;
    }

}