/*
 * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

/*
 * $Id$
 */

// 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.document.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();
  }
}
