1 23 24 package javax.enterprise.deploy.shared; 25 26 32 public class DConfigBeanVersionType 33 { 34 private int value; 36 39 public static final DConfigBeanVersionType V1_3 = 40 new DConfigBeanVersionType (0); 41 42 46 public static final DConfigBeanVersionType V1_3_1 = 47 new DConfigBeanVersionType (1); 48 49 52 public static final DConfigBeanVersionType V1_4 = 53 new DConfigBeanVersionType (2); 54 55 58 public static final DConfigBeanVersionType V5 = 59 new DConfigBeanVersionType (3); 60 61 private static final String [] stringTable = { 62 "V1_3", 63 "V1_3_1", 64 "V1_4", 65 "V5" 66 }; 67 68 private static final DConfigBeanVersionType [] enumValueTable = { 69 V1_3, 70 V1_3_1, 71 V1_4, 72 V5 73 }; 74 75 76 81 protected DConfigBeanVersionType(int value) 82 { this.value = value; 83 } 84 85 89 public int getValue() 90 { return value; 91 } 92 93 94 97 protected String [] getStringTable() 98 { 99 return stringTable; 100 } 101 102 105 protected DConfigBeanVersionType [] getEnumValueTable() 106 { 107 return enumValueTable; 108 } 109 110 114 public static DConfigBeanVersionType getDConfigBeanVersionType(int value) 115 { return enumValueTable[value]; 116 } 117 118 122 public String toString() 123 { 124 String [] strTable = getStringTable(); 125 int index = value - getOffset(); 126 if (strTable != null && index >= 0 && index < strTable.length) 127 return strTable[index]; 128 else 129 return Integer.toString (value); 130 } 131 132 139 protected int getOffset() 140 { return 0; 141 } 142 } 143 | Popular Tags |