1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor.types;
9
10
11
12
13
14
15
16
17 public class CategoryType implements java.io.Serializable {
18
19
20
21
22
23
24
25
26
27 public static final int BASIC_CAPABILITY_TYPE = 0;
28
29
30
31
32 public static final CategoryType BASIC_CAPABILITY = new CategoryType(BASIC_CAPABILITY_TYPE, "basic capability");
33
34
35
36
37 public static final int SPECIAL_CASE_TYPE = 1;
38
39
40
41
42 public static final CategoryType SPECIAL_CASE = new CategoryType(SPECIAL_CASE_TYPE, "special case");
43
44
45
46
47 private static java.util.Hashtable _memberTable = init();
48
49
50
51
52 private final int type;
53
54
55
56
57 private java.lang.String stringValue = null;
58
59
60
61
62
63
64 private CategoryType(final int type, final java.lang.String value) {
65 super();
66 this.type = type;
67 this.stringValue = value;
68 }
69
70
71
72
73
74
75
76
77
78
79
80
81
82 public static java.util.Enumeration enumerate(
83 ) {
84 return _memberTable.elements();
85 }
86
87
88
89
90
91
92 public int getType(
93 ) {
94 return this.type;
95 }
96
97
98
99
100
101
102 private static java.util.Hashtable init(
103 ) {
104 java.util.Hashtable members = new java.util.Hashtable();
105 members.put("basic capability", BASIC_CAPABILITY);
106 members.put("special case", SPECIAL_CASE);
107 return members;
108 }
109
110
111
112
113
114
115
116
117 private java.lang.Object readResolve(
118 ) {
119 return valueOf(this.stringValue);
120 }
121
122
123
124
125
126
127
128 public java.lang.String toString(
129 ) {
130 return this.stringValue;
131 }
132
133
134
135
136
137
138
139
140 public static org.exolab.castor.tests.framework.testDescriptor.types.CategoryType valueOf(
141 final java.lang.String string) {
142 java.lang.Object obj = null;
143 if (string != null) {
144 obj = _memberTable.get(string);
145 }
146 if (obj == null) {
147 String err = "" + string + " is not a valid CategoryType";
148 throw new IllegalArgumentException(err);
149 }
150 return (CategoryType) obj;
151 }
152
153 }