@Test public void testInvalidFloat() { assertFalse(victim.isValid(-0.1f, null)); }
@Override public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) { if (value == null) { return true; } if (value instanceof BigDecimal) { return ((BigDecimal) value).compareTo(BigDecimal.ZERO) == 1; } else if (value instanceof BigInteger) { return ((BigInteger) value).compareTo(BigInteger.ZERO) == 1; } else { return value.floatValue() > 0; } }
PositiveNumberValidator implements ConstraintValidator<Positive, Number> { @Override public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) { if (value == null) { return true; } if (value instanceof BigDecimal) { return ((BigDecimal) value).compareTo(BigDecimal.ZERO) == 1; } else if (value instanceof BigInteger) { return ((BigInteger) value).compareTo(BigInteger.ZERO) == 1; } else { return value.floatValue() > 0; } } }
PositiveNumberValidator implements ConstraintValidator<Positive, Number> { @Override public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) { if (value == null) { return true; } if (value instanceof BigDecimal) { return ((BigDecimal) value).compareTo(BigDecimal.ZERO) == 1; } else if (value instanceof BigInteger) { return ((BigInteger) value).compareTo(BigInteger.ZERO) == 1; } else { return value.floatValue() > 0; } }  }
PositiveNumberValidator implements ConstraintValidator<Positive, Number> { @Override public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) { if (value == null) { return true; } if (value instanceof BigDecimal) { return ((BigDecimal) value).compareTo(BigDecimal.ZERO) == 1; } else if (value instanceof BigInteger) { return ((BigInteger) value).compareTo(BigInteger.ZERO) == 1; } else { return value.floatValue() > 0; } }  @Override void initialize(Positive minValue); @Override boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext); }
PositiveNumberValidator implements ConstraintValidator<Positive, Number> { @Override public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) { if (value == null) { return true; } if (value instanceof BigDecimal) { return ((BigDecimal) value).compareTo(BigDecimal.ZERO) == 1; } else if (value instanceof BigInteger) { return ((BigInteger) value).compareTo(BigInteger.ZERO) == 1; } else { return value.floatValue() > 0; } }  @Override void initialize(Positive minValue); @Override boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext);  }