class MinValidatorForNumber implements ConstraintValidator<Min, Number> {

	public boolean isValid(Number value, ConstraintValidatorContext constraintValidatorContext) {
		//null values are valid
		if ( value == null ) {
			return true;
		}
		if ( value instanceof BigDecimal ) {
			return ( ( BigDecimal ) value ).compareTo( BigDecimal.valueOf( minValue ) ) != -1;
		}
		else if ( value instanceof BigInteger ) {
			return ( ( BigInteger ) value ).compareTo( BigInteger.valueOf( minValue ) ) != -1;
		}
		else {
			double doubleValue = value.doubleValue();
			return doubleValue >= minValue;
		}

	}

}