当前位置:网站首页>General enumeration constant class
General enumeration constant class
2022-04-23 04:42:00 【Move up】
Solve many problems if else Value problem
import lombok.Getter;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
/** * CommonEnum End enumeration */
public interface CommonEnum {
/** * Template type 0 Talking skill 1 SMS */
@Getter
enum TeamTypeEnum {
TALK_TYPE(0, " key word 1"),
SMS_TYPE(1, " key word 2");
private Integer code;
private String name;
TeamTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
private static Map<Integer, TeamTypeEnum> map = new HashMap<>();
static {
EnumSet.allOf(TeamTypeEnum.class).forEach(e -> map.put(e.getCode(), e));
}
public static String getNameByCode(Integer code) {
TeamTypeEnum e = map.get(code);
if (null == e) {
return "";
}
return e.getName();
}
}
/** * The way of booking */
@Getter
enum ReserveTypeEnum {
PUBLICE(1, "one"),
PRIVATE(2, "twe");
private Integer code;
private String name;
ReserveTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
}
}
版权声明
本文为[Move up]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220558499347.html
边栏推荐
- test
- 顺序表的基本操作
- Spark small case - RDD, broadcast
- 1个需求的一生,团队协作在云效钉钉小程序上可以这么玩
- Effects of antibiotics on microbiome and human health
- Solutions to the failure of sqoop connection to MySQL
- C language: spoof games
- Improving 3D object detection with channel wise transformer
- A lifetime of needs, team collaboration can play this way on cloud nailing applet
- What is the thirty-six plan
猜你喜欢

Flink's important basics

Effects of antibiotics on microbiome and human health

Recursive call -- Enumeration of permutations

Small volume Schottky diode compatible with nsr20f30nxt5g

QML advanced (IV) - drawing custom controls

520. Detect capital letters

Eight misunderstandings that should be avoided in data visualization

Spark optimization

Coinbase: basic knowledge, facts and statistics about cross chain bridge
![[paper reading] [3D object detection] voxel transformer for 3D object detection](/img/a2/9f66789cc12fad99491309717cf418.png)
[paper reading] [3D object detection] voxel transformer for 3D object detection
随机推荐
Alibaba tip: it is better to create threads manually
Shanghai Hangxin technology sharing 𞓜 overview of safety characteristics of acm32 MCU
Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)
Spark optimization
thymeleaf th:value 为null时报错问题
test
MySQL - data read / write separation, multi instance
FAQ of foreign lead and alliance Manager
Summary of MySQL de duplication methods
Programmers complain: I really can't live with a salary of 12000. Netizen: how can I say 3000
Eksctl deploying AWS eks
No such file or directory problem while executing shell
QML进阶(五)-通过粒子模拟系统实现各种炫酷的特效
补充番外14:cmake实践项目笔记(未完待续4/22)
Supplement 14: cmake practice project notes (to be continued 4 / 22)
What is a data island? Why is there still a data island in 2022?
Youqilin 22.04 lts version officially released | ukui 3.1 opens a new experience
win10, mysql-8.0.26-winx64.zip 安装
520. Detect capital letters
Last day of 2017