All Downloads are FREE. Search and download functionalities are using the official Maven repository.

plus.jdk.validator.Max Maven / Gradle / Ivy

The newest version!
package plus.jdk.validator;

import plus.jdk.ananotaions.ValidationRule;
import plus.jdk.common.IValidator;
import plus.jdk.common.ValidateException;

import java.lang.reflect.Field;

public class Max implements IValidator {
    @Override
    public void validate(ValidationRule validationRule, String fieldName, Object fieldValue, Field field, Object input, Object args) throws ValidateException {
        double value = Double.parseDouble(String.valueOf(fieldValue));
        double argsValue = (double) args;
        if(value > argsValue) {
            throw new ValidateException(validationRule.message());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy