create your enum class in the following format.

public class SortingTypes implements java.io.Serializable
{
    private java.lang.String _value_;
    private static java.util.HashMap _table_ = new java.util.HashMap();

    // Constructor
    protected SortingTypes(java.lang.String value)
    {
        _value_ = value;
        _table_.put(_value_,this);
    }

    public static final java.lang.String _ASC = "ASC";
    public static final java.lang.String _DESC = "DESC";
    public static final SortingTypes ASC = new SortingTypes(_ASC);
    public static final SortingTypes DESC = new SortingTypes(_DESC);
    public java.lang.String getValue() { return _value_;}
    public static SortingTypes fromValue(java.lang.String value)
          throws java.lang.IllegalArgumentException
    {
        SortingTypes enumeration = (SortingTypes)
            _table_.get(value);
        if (enumeration==null) throw new java.lang.IllegalArgumentException();
        return enumeration;
    }
    public static SortingTypes fromString(java.lang.String value)
          throws java.lang.IllegalArgumentException
    {
        return fromValue(value);
    }
    public boolean equals(java.lang.Object obj) {return (obj == this);}
    public int hashCode() { return toString().hashCode();}
    public java.lang.String toString() { return _value_;}
    public java.lang.Object readResolve() throws java.io.ObjectStreamException 
{ return fromValue(_value_);}

}


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984265#3984265

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984265
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to