/* * This class was automatically generated with * Castor 1.0.5, using an XML * Schema. * $Id$ */ package org.oagis.codelists.types; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import java.util.Hashtable; /** * Class SystemEnvironmentCodeEnumerationType. * * @version $Revision$ $Date$ */ public class SystemEnvironmentCodeEnumerationType implements java.io.Serializable { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * The Production type */ public static final int PRODUCTION_TYPE = 0; /** * The instance of the Production type */ public static final SystemEnvironmentCodeEnumerationType PRODUCTION = new SystemEnvironmentCodeEnumerationType(PRODUCTION_TYPE, "Production"); /** * The Test type */ public static final int TEST_TYPE = 1; /** * The instance of the Test type */ public static final SystemEnvironmentCodeEnumerationType TEST = new SystemEnvironmentCodeEnumerationType(TEST_TYPE, "Test"); /** * Field _memberTable */ private static java.util.Hashtable _memberTable = init(); /** * Field type */ private int type = -1; /** * Field stringValue */ private java.lang.String stringValue = null; //----------------/ //- Constructors -/ //----------------/ private SystemEnvironmentCodeEnumerationType(int type, java.lang.String value) { super(); this.type = type; this.stringValue = value; } //-- org.oagis.codelists.types.SystemEnvironmentCodeEnumerationType(int, java.lang.String) //-----------/ //- Methods -/ //-----------/ /** * Method enumerate * * Returns an enumeration of all possible instances of * SystemEnvironmentCodeEnumerationType * * @return an Enumeration over all possible instances of * SystemEnvironmentCodeEnumerationType */ public static java.util.Enumeration enumerate() { return _memberTable.elements(); } //-- java.util.Enumeration enumerate() /** * Method getType * * Returns the type of this * SystemEnvironmentCodeEnumerationType * * @return the type of this SystemEnvironmentCodeEnumerationType */ public int getType() { return this.type; } //-- int getType() /** * Method init * * * * @return the initialized Hashtable for the member table */ private static java.util.Hashtable init() { Hashtable members = new Hashtable(); members.put("Production", PRODUCTION); members.put("Test", TEST); return members; } //-- java.util.Hashtable init() /** * Method readResolve * * will be called during deserialization to replace the * deserialized object with the correct constant instance. * * @return this deserialized object */ private java.lang.Object readResolve() { return valueOf(this.stringValue); } //-- java.lang.Object readResolve() /** * Method toString * * Returns the String representation of this * SystemEnvironmentCodeEnumerationType * * @return the String representation of this * SystemEnvironmentCodeEnumerationType */ public java.lang.String toString() { return this.stringValue; } //-- java.lang.String toString() /** * Method valueOf * * Returns a new SystemEnvironmentCodeEnumerationType based on * the given String value. * * @param string * @return the SystemEnvironmentCodeEnumerationType value of * parameter 'string' */ public static org.oagis.codelists.types.SystemEnvironmentCodeEnumerationType valueOf(java.lang.String string) { java.lang.Object obj = null; if (string != null) obj = _memberTable.get(string); if (obj == null) { String err = "'" + string + "' is not a valid SystemEnvironmentCodeEnumerationType"; throw new IllegalArgumentException(err); } return (SystemEnvironmentCodeEnumerationType) obj; } //-- org.oagis.codelists.types.SystemEnvironmentCodeEnumerationType valueOf(java.lang.String) }