Skip to content
Snippets Groups Projects

Feature/zjh

Closed 张君豪 requested to merge feature/zjh into develop
Compare and
11 files
+ 316
38
Compare changes
  • Side-by-side
  • Inline
Files
11
package com.seasky.template.enums;
/**
* 经费类别
* @program:
* @author: kejinlong
**/
public enum TaskListEnum {
FIXED_AMOUNT("固定额度","01"),
FLOAT_AMOUNT("浮动额度","02"),
YEAR_FIXED("年中固定","011"),
YEAR_FLOAT("年中浮动","021");
/**
* 枚举属性说明
*/
private final String name;
private final String index;
TaskListEnum(String name, String index) {
this.name = name;
this.index = index;
}
public String getName() {
return name;
}
public String getIndex() {
return index;
}
/**
* 通过key 查找描述 方法
*
* @param index
*/
public static TaskListEnum getValueByIndex(String index) {
for (TaskListEnum openEnum : TaskListEnum.values()) {
if (openEnum.getIndex().equals(index)) {
return openEnum;
}
}
throw new IllegalArgumentException(index + "? There is no such value!");
}
}