/*
 * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
 * Copyright (c) 2002 International Business Machines Corp. 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
 */

// Helper class generated by xrpcc, do not edit.
// Contents subject to change without notice.

package com.sun.ts.tests.jaxrpc.ee.w2j.rpc.encoded.xmlnamemappingtest;

public class EyeColor implements java.io.Serializable {
  private java.lang.String value;

  public static final String _BrownString = "Brown";

  public static final String _BlueString = "Blue";

  public static final String _GreenString = "Green";

  public static final java.lang.String _Brown = new java.lang.String(
      _BrownString);

  public static final java.lang.String _Blue = new java.lang.String(
      _BlueString);

  public static final java.lang.String _Green = new java.lang.String(
      _GreenString);

  public static final EyeColor Brown = new EyeColor(_Brown);

  public static final EyeColor Blue = new EyeColor(_Blue);

  public static final EyeColor Green = new EyeColor(_Green);

  protected EyeColor(java.lang.String value) {
    this.value = value;
  }

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

  public static EyeColor fromValue(java.lang.String value)
      throws java.lang.IllegalStateException {
    if (Brown.value.equals(value)) {
      return Brown;
    } else if (Blue.value.equals(value)) {
      return Blue;
    } else if (Green.value.equals(value)) {
      return Green;
    }
    throw new IllegalArgumentException();
  }

  public static EyeColor fromString(String value)
      throws java.lang.IllegalStateException {
    if (value.equals(_BrownString)) {
      return Brown;
    } else if (value.equals(_BlueString)) {
      return Blue;
    } else if (value.equals(_GreenString)) {
      return Green;
    }
    throw new IllegalArgumentException();
  }

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

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

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