1 16 package org.apache.commons.lang.enum; 17 18 import java.util.Iterator; 19 import java.util.List; 20 import java.util.Map; 21 22 35 36 public final class NestLinked { 37 38 public static final ColorEnum RED = new ColorEnum("Red"); 39 public static final ColorEnum GREEN = new ColorEnum("Green"); 40 public static final ColorEnum BLUE = new ColorEnum("Blue"); 41 42 public NestLinked() { 43 super(); 44 } 45 46 public static final class ColorEnum extends Enum { 47 48 static { 49 Object obj = NestLinked.RED; 51 } 52 53 private ColorEnum(String color) { 54 super(color); 55 } 56 57 public static ColorEnum getEnum(String color) { 58 return (ColorEnum) getEnum(ColorEnum.class, color); 59 } 60 61 public static Map getEnumMap() { 62 return getEnumMap(ColorEnum.class); 63 } 64 65 public static List getEnumList() { 66 return getEnumList(ColorEnum.class); 67 } 68 69 public static Iterator iterator() { 70 return iterator(ColorEnum.class); 71 } 72 } 73 } 74 | Popular Tags |