Commit 710f03d3 authored by 赵啸非's avatar 赵啸非

添加目录字段

parent d5b27230
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 子证状态(0.禁用,1.启用)枚举类
*
* @author zxfei
*/
public enum ChildStatusEnum {
禁用(0, "禁用"),
启用(1, "启用");
private Integer value;
private String desc;
ChildStatusEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static ChildStatusEnum getByValue(Integer value) {
for (ChildStatusEnum childStatusEnum : ChildStatusEnum.values()) {
if (childStatusEnum.getValue() == value) {
return childStatusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (ChildStatusEnum item : ChildStatusEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 删除状态(0.未删除,1.已删除)枚举类
*
* @author zxfei
*/
public enum DeletedEnum {
未删除(0, "未删除"),
已删除(1, "已删除");
private Integer value;
private String desc;
DeletedEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DeletedEnum getByValue(Integer value) {
for (DeletedEnum deletedEnum : DeletedEnum.values()) {
if (deletedEnum.getValue() == value) {
return deletedEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DeletedEnum item : DeletedEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment