title: Java switch case statement issue
body: <p>I'm trying to use a switch statement in Android aplication,where I have to check if an integer is equal to some of the Enum's value.The code goes like this :</p>
  
  <pre><code>    public enum RPCServerResponseCode{
  
  
          E_INCORRECT_LOGIN(4001),                
          E_ACCOUNT_DISABLED(4002),
          E_ACCOUNT_NOT_ACTIVE(4003);
  
  
          private int value;
          private RPCServerResponseCode(int i) {
              this.value=i;
          }
          public static RPCServerResponseCode getByValue(int i) {
               for(RPCServerResponseCode dt : RPCServerResponseCode.values()) {
                   if(dt.value == i) {
                       return dt;
                   }
               }
               throw new IllegalArgumentException("No datatype with " + i + " exists");
           }
  
      }
  
  }
  </code></pre>
  
  <p>And my switch statement looks like this :</p>
  
  <pre><code>int errorCode;
  switch(errorCode){
  
              case  RPCServerResponseCode.E_INCORRECT_LOGIN :
              {
                      if (user.isAuthenticated)
                      {
                          // logout before login
                      }
                      break;
              }
              case RPCServerResponseCode.E_ACCOUNT_NOT_ACTIVE:  
              {
                  if (user.isAuthenticated)
                  {
                      //logout
                  }
                  break;
              }
          }
  
      }
  </code></pre>
  
  <p>But I get error saying this : "Type mismatch: cannot convert from RPCCommucatorDefines.RPCServerResponseCode to int".
  Any suggestions how to solce that issue? Thanks in advance!!!</p>