// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1.2_01, build R40)
// Generated source version: 1.1.2

package org.jboss.test.ws.jaxrpc.encoded.parametermode;


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

public class EnumDecimal {
    private java.math.BigDecimal value;
    private static Map valueMap = new HashMap();
    public static final String _value1String = "3512359.1456";
    public static final String _value2String = "3512360.1456";
    
    public static final java.math.BigDecimal _value1 = new java.math.BigDecimal(_value1String);
    public static final java.math.BigDecimal _value2 = new java.math.BigDecimal(_value2String);
    
    public static final EnumDecimal value1 = new EnumDecimal(_value1);
    public static final EnumDecimal value2 = new EnumDecimal(_value2);
    
    protected EnumDecimal(java.math.BigDecimal value) {
        this.value = value;
        valueMap.put(this.toString(), this);
    }
    
    public java.math.BigDecimal getValue() {
        return value;
    }
    
    public static EnumDecimal fromValue(java.math.BigDecimal 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 EnumDecimal fromString(String value)
        throws java.lang.IllegalStateException {
        EnumDecimal ret = (EnumDecimal)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 EnumDecimal)) {
            return false;
        }
        return ((EnumDecimal)obj).value.equals(value);
    }
    
    public int hashCode() {
        return value.hashCode();
    }
}
