package com.fzm.mall.server.front.valid;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Pattern;

/**
 *
 * @author tdz
 * @date 2021/02/22 11:26
 */

public class TypeValid {

    public static boolean one(String type) {
        return StringUtils.isNotBlank(type) && Pattern.matches("^[0-2]$", type);
    }

    public static boolean two(String type) {
        return StringUtils.isNotBlank(type) && Pattern.matches("^[0-2]$", type);
    }

    public static boolean three(String type) {
        return StringUtils.isNotBlank(type) && Pattern.matches("^[0-3]$", type);
    }

    public static boolean four(String type) {
        return StringUtils.isNotBlank(type) && Pattern.matches("^[0-4]$", type);
    }

    public static boolean five(String type) {
        return StringUtils.isNotBlank(type) && Pattern.matches("^[0-30]$", type);
    }

}
