/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
 * Schema.
 * $Id$
 */

package nz.co.cks.tms.xml.types;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 * CKS TMS NCB Types
 * 
 * @version $Revision$ $Date$
 */
public class NcbTypeType implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * The Organisation type
     */
    public static final int VALUE_0_TYPE = 0;

    /**
     * The instance of the Organisation type
     */
    public static final NcbTypeType VALUE_0 = new NcbTypeType(VALUE_0_TYPE, "Organisation");

    /**
     * The Organisation Unit type
     */
    public static final int VALUE_1_TYPE = 1;

    /**
     * The instance of the Organisation Unit type
     */
    public static final NcbTypeType VALUE_1 = new NcbTypeType(VALUE_1_TYPE, "Organisation Unit");

    /**
     * The Person type
     */
    public static final int VALUE_2_TYPE = 2;

    /**
     * The instance of the Person type
     */
    public static final NcbTypeType VALUE_2 = new NcbTypeType(VALUE_2_TYPE, "Person");

    /**
     * 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 NcbTypeType(int type, java.lang.String value) {
        super();
        this.type = type;
        this.stringValue = value;
    } //-- nz.co.cks.tms.xml.types.NcbTypeType(int, java.lang.String)


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method enumerateReturns an enumeration of all possible
     * instances of NcbTypeType
     */
    public static java.util.Enumeration enumerate()
    {
        return _memberTable.elements();
    } //-- java.util.Enumeration enumerate() 

    /**
     * Method getTypeReturns the type of this NcbTypeType
     */
    public int getType()
    {
        return this.type;
    } //-- int getType() 

    /**
     * Method init
     */
    private static java.util.Hashtable init()
    {
        Hashtable members = new Hashtable();
        members.put("Organisation", VALUE_0);
        members.put("Organisation Unit", VALUE_1);
        members.put("Person", VALUE_2);
        return members;
    } //-- java.util.Hashtable init() 

    /**
     * Method toStringReturns the String representation of this
     * NcbTypeType
     */
    public java.lang.String toString()
    {
        return this.stringValue;
    } //-- java.lang.String toString() 

    /**
     * Method valueOfReturns a new NcbTypeType based on the given
     * String value.
     * 
     * @param string
     */
    public static nz.co.cks.tms.xml.types.NcbTypeType 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 NcbTypeType";
            throw new IllegalArgumentException(err);
        }
        return (NcbTypeType) obj;
    } //-- nz.co.cks.tms.xml.types.NcbTypeType valueOf(java.lang.String) 

}
