Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum MyEnum {
- ONE("1"),
- TWO("2")
- ;
- private String link;
- MyEnum(String link) {
- this.link = link;
- }
- }
- static {
- MyEnum[] enums = MyEnum.values();
- MyEnum myEnum = null;
- for (MyEnum anEnum : enums) {
- if (anEnum.name().equalsIgnoreCase("one")) {
- myEnum = anEnum;
- break;
- }
- }
- // мы нашли myEnum по названию "one"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement