title: Deserialize JSON to Java enum
body: <p>I have the following enumeration in Java on Android and I would like to be able to deserialize an integer in an incoming JSON string/object into this Enum type. I have been getting hits on Jackson and GSON but nothing on the JSON.org package, which I am using.</p>
  
  <p>Is there an easy way to do this or do I need to alter the JSON decoder? Thanks.</p>
  
  <pre><code>public enum ValueEnum {
  
      ONE(1),
      TWO(2),
      THREE(3);
  
      private int value;
  
      private ValueEnum(int value) {
          this.value = value;
      }
  
      public int getValue() {
          return value;
      }   
  }
  </code></pre>