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

org.xson.common.validate.rule.CollectionLengthMinChecker Maven / Gradle / Ivy

Go to download

xco-validate based XCO, using xml language to describe data validation framework.

The newest version!
package org.xson.common.validate.rule;

import java.util.List;

import org.xson.common.object.XCO;
import org.xson.common.validate.Checker;

/**
 * List size 最小值
 */
public class CollectionLengthMinChecker implements Checker {

	@Override
	public boolean check(XCO xco, String fieldName, Object value) {
		List list = (List) xco.getObjectValue(fieldName);
		int val = list.size();
		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