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

org.xson.tangyuan.validate.rule.StringLengthMinChecker Maven / Gradle / Ivy

Go to download

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;

/**
 * 字符串长度校验
 */
public class StringLengthMinChecker implements Checker {

	@Override
	public boolean check(XCO xco, String fieldName, Object value) {
		String strVal = xco.getStringValue(fieldName);
		int val = strVal.length();
		int min = ((Integer) value).intValue();
		return min <= val;
	}

	public static Object parseValue(String value) {
		return Integer.parseInt(value);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy