@Getter
@AllArgsConstructor
public enum 枚举名 {
name1(1, “测试名一”),
name2(2, “测试名二”),
name3(11, “测试名三”);
private Integer key;
private String value;
public static 枚举名 getProfitBeneficiary(Integer key) {
if (key == null) {
return null;
}
for (枚举名 ProfitBeneficiary : 枚举名.values()) {
if (key.equals(ProfitBeneficiary.getKey())) {
return ProfitBeneficiary;
}
}
return null;
}
}

16万+

被折叠的 条评论
为什么被折叠?



