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 CoinValid {
    public static boolean prefixSuffix(String coin) {
        return StringUtils.isNotBlank(coin) && Pattern.matches("^(?i)[a-z]{2,7}$", coin);
    }

    public static boolean good(String coin) {
        return StringUtils.isNotBlank(coin) && Pattern.matches("^(?i)sp[a-z]{4,14}$", coin);
    }

    public static boolean coin16(String coin) {
        return StringUtils.isNotBlank(coin) && Pattern.matches("^(?i)[a-z]{1,16}$", coin);
    }

    public static boolean pay(String coin) {
        return StringUtils.isNotBlank(coin) && Pattern.matches("^(?i)(?:bty|ccny)$", coin);
    }
}
