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 28 29 public final class ValuedColorEnum extends ValuedEnum { 30 public static final ValuedColorEnum RED = new ValuedColorEnum("Red", 1); 31 public static final ValuedColorEnum GREEN = new ValuedColorEnum("Green", 2); 32 public static final ValuedColorEnum BLUE = new ValuedColorEnum("Blue", 3); 33 34 private ValuedColorEnum(String color, int value) { 35 super(color, value); 36 } 37 38 public static ValuedColorEnum getEnum(String color) { 39 return (ValuedColorEnum) getEnum(ValuedColorEnum.class, color); 40 } 41 42 public static ValuedColorEnum getEnum(int value) { 43 return (ValuedColorEnum) getEnum(ValuedColorEnum.class, value); 44 } 45 46 public static Map getEnumMap() { 47 return getEnumMap(ValuedColorEnum.class); 48 } 49 50 public static List getEnumList() { 51 return getEnumList(ValuedColorEnum.class); 52 } 53 54 public static Iterator iterator() { 55 return iterator(ValuedColorEnum.class); 56 } 57 } 58 | Popular Tags |