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 31 32 public final class NestReferenced { 33 34 public static final ColorEnum RED = ColorEnum.RED; 35 public static final ColorEnum GREEN = ColorEnum.GREEN; 36 public static final ColorEnum BLUE = ColorEnum.BLUE; 37 38 public NestReferenced() { 39 super(); 40 } 41 42 public static final class ColorEnum extends Enum { 43 44 private static final ColorEnum RED = new ColorEnum("Red"); 46 private static final ColorEnum GREEN = new ColorEnum("Green"); 47 private static final ColorEnum BLUE = new ColorEnum("Blue"); 48 49 private ColorEnum(String color) { 50 super(color); 51 } 52 53 public static ColorEnum getEnum(String color) { 54 return (ColorEnum) getEnum(ColorEnum.class, color); 55 } 56 57 public static Map getEnumMap() { 58 return getEnumMap(ColorEnum.class); 59 } 60 61 public static List getEnumList() { 62 return getEnumList(ColorEnum.class); 63 } 64 65 public static Iterator iterator() { 66 return iterator(ColorEnum.class); 67 } 68 } 69 } 70 | Popular Tags |