/*
 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
/*************************************************************************
   Licensed Materials - Property of IBM
   WSEE1.0 (C) Copyright International Business Machines Corp. 2002
   All Rights Reserved.
   US Government Users Restricted Rights - Use, duplication or
   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
**************************************************************************/
/*************************************************************************
   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
   OR PERFORMANCE OF THIS SOFTWARE.
**************************************************************************/
// Helper class generated by xrpcc, do not edit.
// Contents subject to change without notice.

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

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