package cn.common.common.validation.validator;

import cn.common.common.validation.IsNumberStr;
import cn.common.common.utils.common.CheckParam;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author created by Singer email:singer-coder@qq.com
 * @time 2017/11/20
 * @description
 */
public class IsNumberStrValidator implements ConstraintValidator<IsNumberStr,String> {


    @Override
    public void initialize(IsNumberStr isNumberStr) {

    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        return CheckParam.isNum(value);
    }
}
