使用枚举定义常量
来源:互联网 发布:尼康 35 1.8 知乎 编辑:程序博客网 时间:2024/05/22 04:56
package com.longshine.dataaccess.common.constant;
public class ErrorCodeConstant {
public static enum Msg{
P0201E001("E001","Startup failed, : "),
P0201E002("E002","JobConfig jobID:{} checkMetaColumnNum failed : "),
P0201E003("E003","JobConfig jobID:{} assignNum less than or equal to zero "),
P0201E004("E004","JobConfig jobID:{} ipList is null "),
P0201E005("E005","JobConfig jobID:{} ip is Wrongful "),
P0201E006("E006","JobConfig jobID:{} assignNum and ipList of num is Wrongful "),
P0201E007("E007","JobConfig jobID:{} IntaskStrategy strategyName Contains Chinese characters "),
P0201E008("E008","JobConfig jobID:{} OuttaskStrategy strategyName Contains Chinese characters "),
P0201E009("E009","JobConfig jobID:{} IntaskStrategy strategyName Contains special characters "),
P0201E010("E010","JobConfig jobID:{} OuttaskStrategy strategyName Contains special characters "),
P0202E001("E001","pluginId is null "),
P0202E002("E002","plugin is not exist,please check pluginId : "),
P0202E003("E003","Startup failed, : "),
P0202E004("E004","taskItemList is wrong or is null please check it's. : "),
P0202E005("E005","TaskParameter is null or The format is not correct.: "),
P0203E001("E001","load all plugins error"),
P0203E002("E002","stop all plugins error"),
P0203E003("E003","load one plugin {} error"),
P0203E004("E004","stop one plugin {} error"),
P0203E005("E005","start one plugin {} error"),
P0203E006("E006","plugin directory({}) not exists"),
P0203E007("E007","start all plugins error"),
P0208E001("E001","data monitor writer zk is error"),
P0210E001("E001","writerChannel datas is null or is empty"),
P0302E001("E001","jobconfig publicsh error"),
P0302E002("E002","jobconfig({})not exists"),
P0302E003("E003","close zkClient error"),
P0302E004("E004","delete jobconfig({}) delete error"),
P0302E005("E005","load zkConfig error"),
P0302E006("E006","loadAllConfig error"),
P2301E001("E001","kafka plugin spring configuration file failed to load "),
P2303E001("E001","kafka plugin datasource failed to convert to EntityProperty class"),
P2300E001("E001","Kafka topic configuration information file does not exist "),
P2300E002("E002","Kafka consumer message failed "),
P2305E001("E001","Kafka Failed to obtain topic information"),
P2401E001("E001","Excel plugin resolve meta file fail"),
P2501E001("E001","Txt plugin resolve meta file fail");
private String code,value;
private Msg(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}
调用时 --ErrorCodeConstant.Msg.P2501E001.getCode(), ErrorCodeConstant.Msg.P2501E001.getValue()
分别对应 "E001"和"Txt plugin resolve meta file fail"
阅读全文
0 0
- 使用枚举定义常量
- 使用枚举类定义常量
- Java提高:推荐使用枚举定义常量
- java推荐使用枚举定义常量
- 定义常量和枚举
- iOS 中的宏定义,常量,与枚举类型使用
- 枚举类的常量定义
- Java 常量定义-枚举enum
- swift中使用宏定义(使用let常量,或enum枚举,或函数)
- 定义类时枚举常量的运用
- 定义常量方式(类,接口,枚举)
- 类里定义常量和枚举
- java 定义枚举+枚举使用
- 提高你的Java代码质量吧:推荐使用枚举定义常量
- Cython基础--C结构体,枚举,以及常量在Cython中的定义和使用
- 提高你的Java代码质量吧:推荐使用枚举定义常量
- Java枚举常量的使用
- java枚举常量的使用
- 远程连接Linux系统下MySQL数据库失败解决方法
- CentOS6.9用yum安装gccError:Cannot find a valid baseurl for repo:base。用yum装httpd80端口被占用。
- Spark基本术语表+基本架构+基本提交运行模式
- a trap in pointer moving
- Python -range 与xrange
- 使用枚举定义常量
- itext打印PDF
- centos系统下安装javaJDK
- Android 嵌套滑动——NestedScrolling完全解析
- vue.js实现数据驱动视图原理
- 【一道数学题】从(0,0)点经过(x,y)点到达(a,b)点的最短路径有多少条
- Hanoi拓展(java)
- jQuery加载页面小结
- Java