class CoordinatesValidator implements ConstraintValidator<ValidCoordinates, RectangularBox> {

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

}