package cn.common.common.validation.validator;

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

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

/**
 * @author created by Singer email:singer-coder@qq.com
 * @time 2017/11/17
 * @description 验证器
 */
public class NotEmptyValidator implements ConstraintValidator<NotEmpty,Object>{


    @Override
    public void initialize(NotEmpty notEmpty) {

    }

    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {


        return !CheckParam.isNull(value);
    }

}
