/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
 * Schema.
 * $Id$
 */

package org.gria.serviceprovider.dataservice.messaging.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;

/**
 * the status that an account can have
 * 
 * @version $Revision$ $Date$
 */
public class AccountstatusEnum implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * The pendingcreditchecks type
     */
    public static final int PENDINGCREDITCHECKS_TYPE = 0;

    /**
     * The instance of the pendingcreditchecks type
     */
    public static final AccountstatusEnum PENDINGCREDITCHECKS = new AccountstatusEnum(PENDINGCREDITCHECKS_TYPE, "pendingcreditchecks");

    /**
     * The denied type
     */
    public static final int DENIED_TYPE = 1;

    /**
     * The instance of the denied type
     */
    public static final AccountstatusEnum DENIED = new AccountstatusEnum(DENIED_TYPE, "denied");

    /**
     * The open type
     */
    public static final int OPEN_TYPE = 2;

    /**
     * The instance of the open type
     */
    public static final AccountstatusEnum OPEN = new AccountstatusEnum(OPEN_TYPE, "open");

    /**
     * The suspended type
     */
    public static final int SUSPENDED_TYPE = 3;

    /**
     * The instance of the suspended type
     */
    public static final AccountstatusEnum SUSPENDED = new AccountstatusEnum(SUSPENDED_TYPE, "suspended");

    /**
     * The accountusagefinished type
     */
    public static final int ACCOUNTUSAGEFINISHED_TYPE = 4;

    /**
     * The instance of the accountusagefinished type
     */
    public static final AccountstatusEnum ACCOUNTUSAGEFINISHED = new AccountstatusEnum(ACCOUNTUSAGEFINISHED_TYPE, "accountusagefinished");

    /**
     * The closed type
     */
    public static final int CLOSED_TYPE = 5;

    /**
     * The instance of the closed type
     */
    public static final AccountstatusEnum CLOSED = new AccountstatusEnum(CLOSED_TYPE, "closed");

    /**
     * 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 AccountstatusEnum(int type, java.lang.String value) {
        super();
        this.type = type;
        this.stringValue = value;
    } //-- org.gria.serviceprovider.dataservice.messaging.types.AccountstatusEnum(int, java.lang.String)


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method enumerate
     * 
     * Returns an enumeration of all possible instances of
     * AccountstatusEnum
     * 
     * @return Enumeration
     */
    public static java.util.Enumeration enumerate()
    {
        return _memberTable.elements();
    } //-- java.util.Enumeration enumerate() 

    /**
     * Method getType
     * 
     * Returns the type of this AccountstatusEnum
     * 
     * @return int
     */
    public int getType()
    {
        return this.type;
    } //-- int getType() 

    /**
     * Method init
     * 
     * 
     * 
     * @return Hashtable
     */
    private static java.util.Hashtable init()
    {
        Hashtable members = new Hashtable();
        members.put("pendingcreditchecks", PENDINGCREDITCHECKS);
        members.put("denied", DENIED);
        members.put("open", OPEN);
        members.put("suspended", SUSPENDED);
        members.put("accountusagefinished", ACCOUNTUSAGEFINISHED);
        members.put("closed", CLOSED);
        return members;
    } //-- java.util.Hashtable init() 

    /**
     * Method readResolve
     * 
     *  will be called during deserialization to replace the
     * deserialized object with the correct constant instance.
     * <br/>
     * 
     * @return Object
     */
    private java.lang.Object readResolve()
    {
        return valueOf(this.stringValue);
    } //-- java.lang.Object readResolve() 

    /**
     * Method toString
     * 
     * Returns the String representation of this AccountstatusEnum
     * 
     * @return String
     */
    public java.lang.String toString()
    {
        return this.stringValue;
    } //-- java.lang.String toString() 

    /**
     * Method valueOf
     * 
     * Returns a new AccountstatusEnum based on the given String
     * value.
     * 
     * @param string
     * @return AccountstatusEnum
     */
    public static org.gria.serviceprovider.dataservice.messaging.types.AccountstatusEnum 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 AccountstatusEnum";
            throw new IllegalArgumentException(err);
        }
        return (AccountstatusEnum) obj;
    } //-- org.gria.serviceprovider.dataservice.messaging.types.AccountstatusEnum valueOf(java.lang.String) 

}
