// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1.2_01, build R40)
// Generated source version: 1.1.2

package org.jboss.ws.types;


import java.util.Map;
import java.util.HashMap;

public class USMidwest {
    private java.lang.String value;
    private static Map valueMap = new HashMap();
    public static final String _INString = "IN";
    public static final String _ILString = "IL";
    public static final String _OHString = "OH";

    public static final java.lang.String _IN = new java.lang.String(_INString);
    public static final java.lang.String _IL = new java.lang.String(_ILString);
    public static final java.lang.String _OH = new java.lang.String(_OHString);

    public static final USMidwest IN = new USMidwest(_IN);
    public static final USMidwest IL = new USMidwest(_IL);
    public static final USMidwest OH = new USMidwest(_OH);

    protected USMidwest(java.lang.String value) {
        this.value = value;
        valueMap.put(this.toString(), this);
    }

    public java.lang.String getValue() {
        return value;
    }

    public static USMidwest fromValue(java.lang.String value)
        throws java.lang.IllegalStateException {
        if (IN.value.equals(value)) {
            return IN;
        } else if (IL.value.equals(value)) {
            return IL;
        } else if (OH.value.equals(value)) {
            return OH;
        }
        throw new IllegalArgumentException();
    }

    public static USMidwest fromString(String value)
        throws java.lang.IllegalStateException {
        USMidwest ret = (USMidwest)valueMap.get(value);
        if (ret != null) {
            return ret;
        }
        if (value.equals(_INString)) {
            return IN;
        } else if (value.equals(_ILString)) {
            return IL;
        } else if (value.equals(_OHString)) {
            return OH;
        }
        throw new IllegalArgumentException();
    }

    public String toString() {
        return value.toString();
    }

    private Object readResolve()
        throws java.io.ObjectStreamException {
        return fromValue(getValue());
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof USMidwest)) {
            return false;
        }
        return ((USMidwest)obj).value.equals(value);
    }

    public int hashCode() {
        return value.hashCode();
    }
}