1
我有下面的代碼:如何操作錯誤代碼枚舉
public enum CpAutoExecCode implements CpAutoErrorCode {
//TODO - List of the execution error codes
//Error code sample
GENERIC_EXECUTION_ERROR(200,"Generic execution error code description"),
MISSING_REQUIRED_FIELD(201,"Required field %s is missing from model : %s");
private final int number;
private final String description;
private CpAutoExecCode(int number,String description) {
this.number = number;
this.description = description;
}
@Override
public int getNumber() {
return number;
}
@Override
public String getDescription() {
return description;
}
}
我要分配在%S所需的字段和對象名稱。 有沒有人有一個簡單的方法來做到這一點?