/*
 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

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

// 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.rpc.literal.marshalltest;


public class FooDecimalEnumType implements java.io.Serializable {
    private java.math.BigDecimal value;
    public static final String _value1String = "1.1";
    public static final String _value2String = "2.2";
    public static final String _value3String = "3.3";
    
    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 java.math.BigDecimal _value3 = new java.math.BigDecimal(_value3String);
    
    public static final FooDecimalEnumType value1 = new FooDecimalEnumType(_value1);
    public static final FooDecimalEnumType value2 = new FooDecimalEnumType(_value2);
    public static final FooDecimalEnumType value3 = new FooDecimalEnumType(_value3);
    
    protected FooDecimalEnumType(java.math.BigDecimal value) {
        this.value = value;
    }
    
    public java.math.BigDecimal getValue() {
        return value;
    }
    
    public static FooDecimalEnumType fromValue(java.math.BigDecimal value)
        throws java.lang.IllegalStateException {
        if (value1.value.equals(value)) {
            return value1;
        } else if (value2.value.equals(value)) {
            return value2;
        } else if (value3.value.equals(value)) {
            return value3;
        }
        throw new IllegalArgumentException();
    }
    
    public static FooDecimalEnumType fromString(String value)
        throws java.lang.IllegalStateException {
        if (value.equals(_value1String)) {
            return value1;
        } else if (value.equals(_value2String)) {
            return value2;
        } else if (value.equals(_value3String)) {
            return value3;
        }
        throw new IllegalArgumentException();
    }
    
    public String toString() {
        return value.toString();
    }
    
    public boolean equals(Object obj) {
        if (!(obj instanceof FooDecimalEnumType)) {
            return false;
        }
        return ((FooDecimalEnumType)obj).value.equals(value);
    }
    
    public int hashCode() {
        return value.hashCode();
    }
}
