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

package org.jboss.test.wsrp.core;


import java.util.HashMap;
import java.io.Serializable;

public class CookieProtocol implements Serializable
{
   /** The serialVersionUID */
   private static final long serialVersionUID = 8319850312108124391L;
   private java.lang.String value;
   private static java.util.Map valueMap = new HashMap();
   public static final java.lang.String _noneString = "none";
   public static final java.lang.String _perUserString = "perUser";
   public static final java.lang.String _perGroupString = "perGroup";

   public static final java.lang.String _none = new java.lang.String(_noneString);
   public static final java.lang.String _perUser = new java.lang.String(_perUserString);
   public static final java.lang.String _perGroup = new java.lang.String(_perGroupString);

   public static final CookieProtocol none = new CookieProtocol(_none);
   public static final CookieProtocol perUser = new CookieProtocol(_perUser);
   public static final CookieProtocol perGroup = new CookieProtocol(_perGroup);

   protected CookieProtocol(java.lang.String value)
   {
      this.value = value;
      valueMap.put(this.toString(), this);
   }

   public java.lang.String getValue()
   {
      return value;
   }

   public static CookieProtocol fromValue(java.lang.String value)
      throws java.lang.IllegalStateException
   {
      if (none.value.equals(value))
      {
         return none;
      }
      else if (perUser.value.equals(value))
      {
         return perUser;
      }
      else if (perGroup.value.equals(value))
      {
         return perGroup;
      }
      throw new java.lang.IllegalArgumentException();
   }

   public static CookieProtocol fromString(java.lang.String value)
      throws java.lang.IllegalStateException
   {
      CookieProtocol ret = (CookieProtocol)valueMap.get(value);
      if (ret != null)
      {
         return ret;
      }
      if (value.equals(_noneString))
      {
         return none;
      }
      else if (value.equals(_perUserString))
      {
         return perUser;
      }
      else if (value.equals(_perGroupString))
      {
         return perGroup;
      }
      throw new IllegalArgumentException();
   }

   public java.lang.String toString()
   {
      return value.toString();
   }

   private java.lang.Object readResolve()
      throws java.io.ObjectStreamException
   {
      return fromValue(getValue());
   }

   public boolean equals(java.lang.Object obj)
   {
      if (!(obj instanceof CookieProtocol))
      {
         return false;
      }
      return ((CookieProtocol)obj).value.equals(value);
   }

   public int hashCode()
   {
      return value.hashCode();
   }
}
