org.nutz.validate.impl.IntEnumValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.validate.impl;
import java.util.ArrayList;
import java.util.List;
import org.nutz.castor.Castors;
import org.nutz.lang.Each;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.validate.NutValidateException;
import org.nutz.validate.NutValidator;
public class IntEnumValidator implements NutValidator {
private int[] nbs;
public IntEnumValidator(Object any) {
// 拆掉字符串
if (any instanceof CharSequence) {
any = Strings.splitIgnoreBlank(any.toString());
}
// 全都变成数字
final List list = new ArrayList();
Lang.each(any, new Each