package com.brilliance.isc.common.validator.es.rule.impl;

import com.brilliance.isc.common.validator.es.rule.IEnumRule;
import com.brilliance.isc.common.validator.es.utils.EsConstant;
import org.springframework.stereotype.Component;

/**
 * 枚举校验规则
 * @author fukai
 */
@Component(EsConstant.VALIDATOR_TYPE_ENUM +"."+EsConstant.VALIDATOR_SUFFIX_NAME)
public class EnumRuleImpl extends AbstractRuleValidator implements IEnumRule {

    /**
     * 获取当前校验器的js实现函数
     *
     * @return
     */
    @Override
    public String getValidateFunction() {
        return String.format("execute%sRule",toUpperFirst(EsConstant.VALIDATOR_TYPE_ENUM));
    }
}
