
org.xson.tangyuan.validate.rule.FloatMaxChecker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tangyuan-validate Show documentation
Show all versions of tangyuan-validate Show documentation
tangyuan-validate is the data validation component in the tangyuan framework that provides data validation based on XCO objects.
The newest version!
package org.xson.tangyuan.validate.rule;
import org.xson.common.object.XCO;
import org.xson.tangyuan.validate.Checker;
/**
* float型最大值校验
*/
public class FloatMaxChecker implements Checker {
@Override
public boolean check(XCO xco, String fieldName, Object value) {
float max = ((Float) value).floatValue();
float val = xco.getFloatValue(fieldName);
return max >= val;
}
public static Object parseValue(String value) {
return Float.parseFloat(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy