All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.cn9750wang.webtools.error.defines.ParamErr Maven / Gradle / Ivy

The newest version!
/*
 *    Copyright 2021 wwy
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package com.gitee.cn9750wang.webtools.error.defines;

import com.gitee.cn9750wang.webtools.error.ErrorCode;
import com.gitee.cn9750wang.webtools.vo.result.error.ErrorMessage;

import static com.gitee.cn9750wang.webtools.error.defines.Errors.P;

/**
 * 参数错误
 * @author wwu
 */
public enum ParamErr implements ErrEnum{
    /** 参数:[%s]只能为null */
    NULL(P,"参数:[%s]只能为null"),

    /** 参数:[%s]必须不为null */
    NOT_NULL(P.increase(1),"参数:[%s]必须不为null"),

    /** 参数:[%s]必须为false */
    FALSE(P.increase(2),"参数:[%s]必须为false"),

    /** 参数:[%s]必须为true */
    TRUE(P.increase(3),"参数:[%s]必须为true"),

    /** 参数:[%s]必须为一个不大于%s的数字 */
    DECIMAL_MAX(P.increase(4),"参数:[%s]必须为一个不大于%s的数字"),

    /** 参数:[%s]必须为一个不小于%s的数字 */
    DECIMAL_MIN(P.increase(5),"参数:[%s]必须为一个不小于%s的数字"),

    /** 参数:[%s]必须为一个小数,且整数部分的位数不能超过%s,小数部分的位数不能超过%s */
    DIGITS(P.increase(6),"参数:[%s]必须为一个小数,且整数部分的位数不能超过%s,小数部分的位数不能超过%s"),

    /** 参数:[%s]必须是一个将来的日期 */
    FUTURE(P.increase(7),"参数:[%s]必须是一个将来的日期"),

    /** 参数:[%s]必须是一个过去的日期 */
    PAST(P.increase(8),"参数:[%s]必须是一个过去的日期"),

    /** 参数:[%s]格式不正确 */
    PATTERN(P.increase(9),"参数:[%s]格式不正确"),

    /** 参数:[%s]字符长度必须在%s到%s之间 */
    SIZE(P.increase(10),"参数:[%s]字符长度必须在%s到%s之间"),

    /** 参数:[%s]不为null且大小不为0 */
    NOT_EMPTY(P.increase(11),"参数:[%s]不为null且大小不为0"),

    /** 参数:[%s]不为空白字符串 */
    NOT_BLANK(P.increase(12),"参数:[%s]不为空白字符串"),

    /** 参数:[%s]应为指定格式的邮箱地址 */
    EMAIL(P.increase(13),"参数:[%s]应为指定格式的邮箱地址"),

    /** 参数:[%s]错误 */
    PARAM_ERR(P.increase(14),"参数:[%s]错误"),

    /** 参数:[%s]必须在%s到%s之间 */
    BETWEEN(P.increase(15),"参数:[%s]必须在%s到%s之间"),

    /** 参数:[%s]非法 */
    ILLEGAL(P.increase(16),"参数:[%s]非法"),

    /** 参数:[%s]不可用作排序 */
    UN_SORT(P.increase(17),"参数:[%s]不可用作排序"),

    ;

    ParamErr(ErrorCode code, String msg){
        this(new ErrorMessage(code,msg));
    }

    ParamErr(ErrorMessage message){
        this.message = message;
    }

    private final ErrorMessage message;

    @Override
    public ErrorMessage getMessage() {
        return message;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy