Commit 39e99d0c authored by yff's avatar yff

路径枚举

parent 9777cf3b
package com.gavel.kwell.utils;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.gavel.kzzx.model.GavelEnumModel;
public enum YymkFKEnum {
ZP("ZP", "901000200"),
JY("JY","901000400"),
WX("WX","901000600");
private String id;
private String name;
YymkFKEnum(String id, String name){
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static String getNameById(String id) {
if(StringUtils.isNotEmpty(id)) {
for (YymkFKEnum e : YymkFKEnum.values()) {
if(e.getId().equals(id)) {
return e.getName();
}
}
}
return null;
}
public static List<GavelEnumModel> toList() {
List<GavelEnumModel> list = new ArrayList<>();
for (YymkFKEnum e : YymkFKEnum.values()) {
GavelEnumModel gavelEnumModel = new GavelEnumModel();
gavelEnumModel.setId(e.getId());
gavelEnumModel.setName(e.getName());
list.add(gavelEnumModel);
}
return list;
}
}
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