67 lines
1.6 KiB
Java
67 lines
1.6 KiB
Java
package com.engine.salary.enums.ly;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/**
|
|
* @author Harryxzy
|
|
* @ClassName LyJDDirectionTypeEnum
|
|
* @date 2024/08/27 17:54
|
|
* @description 领悦 - 推送状态类型
|
|
*/
|
|
public enum LyPushStatusEnum {
|
|
|
|
WAIT(0, "未推送", 0),
|
|
SUCCESS(1, "推送成功", 0),
|
|
FAIL(2, "推送失败", 0);
|
|
|
|
private int value;
|
|
|
|
private String defaultLabel;
|
|
|
|
private int labelId;
|
|
|
|
LyPushStatusEnum(int value, String defaultLabel, int labelId) {
|
|
this.value = value;
|
|
this.defaultLabel = defaultLabel;
|
|
this.labelId = labelId;
|
|
}
|
|
|
|
public int getValue() {
|
|
return value;
|
|
}
|
|
|
|
public String getDefaultLabel() {
|
|
return defaultLabel;
|
|
}
|
|
|
|
public int getLabelId() {
|
|
return labelId;
|
|
}
|
|
|
|
public static String getDefaultLabelByValue(Integer value) {
|
|
if (value == null) {
|
|
return WAIT.getDefaultLabel();
|
|
}
|
|
LyPushStatusEnum[] enumAry = LyPushStatusEnum.values();
|
|
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
|
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
|
return enumAry[i].getDefaultLabel();
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
public static String getNameByValue(Integer value) {
|
|
if (value == null) {
|
|
return "";
|
|
}
|
|
LyPushStatusEnum[] enumAry = LyPushStatusEnum.values();
|
|
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
|
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
|
return enumAry[i].name();
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
}
|