@Test public void testTopNegative() { TestUtils.setProperty(box, "top", -1); assertFalse(victim.isValid(box, null)); }
@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; }
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; } }
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; }  }
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; }  @Override void initialize(NotNegativeCoordinates constraintAnnotation); @Override boolean isValid(RectangularBox value, ConstraintValidatorContext context); }
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; }  @Override void initialize(NotNegativeCoordinates constraintAnnotation); @Override boolean isValid(RectangularBox value, ConstraintValidatorContext context);  }