/*
 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * $Id: FooStringEnumType.java 62536 2011-04-15 16:35:14Z af70133 $
 */

// This class was generated by the JAXRPC RI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Reference Implementation (1.1, build EA-R15)

package com.sun.ts.tests.jaxrpc.ee.wsi.rpc.literal.marshalltest;


public class FooStringEnumType implements java.io.Serializable {
    private java.lang.String value;
    public static final String _MAString = "MA";
    public static final String _NHString = "NH";
    public static final String _VTString = "VT";
    public static final String _MEString = "ME";
    public static final String _RIString = "RI";
    
    public static final java.lang.String _MA = new java.lang.String(_MAString);
    public static final java.lang.String _NH = new java.lang.String(_NHString);
    public static final java.lang.String _VT = new java.lang.String(_VTString);
    public static final java.lang.String _ME = new java.lang.String(_MEString);
    public static final java.lang.String _RI = new java.lang.String(_RIString);
    
    public static final FooStringEnumType MA = new FooStringEnumType(_MA);
    public static final FooStringEnumType NH = new FooStringEnumType(_NH);
    public static final FooStringEnumType VT = new FooStringEnumType(_VT);
    public static final FooStringEnumType ME = new FooStringEnumType(_ME);
    public static final FooStringEnumType RI = new FooStringEnumType(_RI);
    
    protected FooStringEnumType(java.lang.String value) {
        this.value = value;
    }
    
    public java.lang.String getValue() {
        return value;
    }
    
    public static FooStringEnumType fromValue(java.lang.String value)
        throws java.lang.IllegalStateException {
        if (MA.value.equals(value)) {
            return MA;
        } else if (NH.value.equals(value)) {
            return NH;
        } else if (VT.value.equals(value)) {
            return VT;
        } else if (ME.value.equals(value)) {
            return ME;
        } else if (RI.value.equals(value)) {
            return RI;
        }
        throw new IllegalArgumentException();
    }
    
    public static FooStringEnumType fromString(String value)
        throws java.lang.IllegalStateException {
        if (value.equals(_MAString)) {
            return MA;
        } else if (value.equals(_NHString)) {
            return NH;
        } else if (value.equals(_VTString)) {
            return VT;
        } else if (value.equals(_MEString)) {
            return ME;
        } else if (value.equals(_RIString)) {
            return RI;
        }
        throw new IllegalArgumentException();
    }
    
    public String toString() {
        return value.toString();
    }
    
    public boolean equals(Object obj) {
        if (!(obj instanceof FooStringEnumType)) {
            return false;
        }
        return ((FooStringEnumType)obj).value.equals(value);
    }
    
    public int hashCode() {
        return value.hashCode();
    }
}
