View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor.types;
9   
10  /**
11   * The type of test case, either basic capability or a special
12   * case.
13   *  
14   * 
15   * @version $Revision$ $Date$
16   */
17  public class CategoryType implements java.io.Serializable {
18  
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * The basic capability type
26       */
27      public static final int BASIC_CAPABILITY_TYPE = 0;
28  
29      /**
30       * The instance of the basic capability type
31       */
32      public static final CategoryType BASIC_CAPABILITY = new CategoryType(BASIC_CAPABILITY_TYPE, "basic capability");
33  
34      /**
35       * The special case type
36       */
37      public static final int SPECIAL_CASE_TYPE = 1;
38  
39      /**
40       * The instance of the special case type
41       */
42      public static final CategoryType SPECIAL_CASE = new CategoryType(SPECIAL_CASE_TYPE, "special case");
43  
44      /**
45       * Field _memberTable.
46       */
47      private static java.util.Hashtable _memberTable = init();
48  
49      /**
50       * Field type.
51       */
52      private final int type;
53  
54      /**
55       * Field stringValue.
56       */
57      private java.lang.String stringValue = null;
58  
59  
60        //----------------/
61       //- Constructors -/
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       //- Methods -/
73      //-----------/
74  
75      /**
76       * Method enumerate.Returns an enumeration of all possible
77       * instances of CategoryType
78       * 
79       * @return an Enumeration over all possible instances of
80       * CategoryType
81       */
82      public static java.util.Enumeration enumerate(
83      ) {
84          return _memberTable.elements();
85      }
86  
87      /**
88       * Method getType.Returns the type of this CategoryType
89       * 
90       * @return the type of this CategoryType
91       */
92      public int getType(
93      ) {
94          return this.type;
95      }
96  
97      /**
98       * Method init.
99       * 
100      * @return the initialized Hashtable for the member table
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      * Method readResolve. will be called during deserialization to
112      * replace the deserialized object with the correct constant
113      * instance.
114      * 
115      * @return this deserialized object
116      */
117     private java.lang.Object readResolve(
118     ) {
119         return valueOf(this.stringValue);
120     }
121 
122     /**
123      * Method toString.Returns the String representation of this
124      * CategoryType
125      * 
126      * @return the String representation of this CategoryType
127      */
128     public java.lang.String toString(
129     ) {
130         return this.stringValue;
131     }
132 
133     /**
134      * Method valueOf.Returns a new CategoryType based on the given
135      * String value.
136      * 
137      * @param string
138      * @return the CategoryType value of parameter 'string'
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 }