/*
 * 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: EnumInteger.java 62536 2011-04-15 16:35:14Z af70133 $
 */

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


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

public class EnumInteger {
    private java.math.BigInteger value;
    private static Map valueMap = new HashMap();
    public static final String _value1String = "3512359";
    public static final String _value2String = "3512360";
    
    public static final java.math.BigInteger _value1 = new java.math.BigInteger(_value1String);
    public static final java.math.BigInteger _value2 = new java.math.BigInteger(_value2String);
    
    public static final EnumInteger value1 = new EnumInteger(_value1);
    public static final EnumInteger value2 = new EnumInteger(_value2);
    
    protected EnumInteger(java.math.BigInteger value) {
        this.value = value;
        valueMap.put(this.toString(), this);
    }
    
    public java.math.BigInteger getValue() {
        return value;
    }
    
    public static EnumInteger fromValue(java.math.BigInteger value)
        throws java.lang.IllegalStateException {
        if (value1.value.equals(value)) {
            return value1;
        } else if (value2.value.equals(value)) {
            return value2;
        }
        throw new IllegalArgumentException();
    }
    
    public static EnumInteger fromString(String value)
        throws java.lang.IllegalStateException {
        EnumInteger ret = (EnumInteger)valueMap.get(value);
        if (ret != null) {
            return ret;
        }
        if (value.equals(_value1String)) {
            return value1;
        } else if (value.equals(_value2String)) {
            return value2;
        }
        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 EnumInteger)) {
            return false;
        }
        return ((EnumInteger)obj).value.equals(value);
    }
    
    public int hashCode() {
        return value.hashCode();
    }
}
