title: Java convert Select to Enum
body: <p>in simple code i'm trying <code>enum</code> instead of <code>select</code> for example i want to convert this code:</p>
  
  <pre><code>switch (name) {
      case "1":
          return "a";
      break;
      case "2":
          return "b";
      case "3":
          return "c";
  }
  </code></pre>
  
  <p>to Enum as:</p>
  
  <pre><code>public enum ContentTypes {
      FREE("1"),
      PAYABLE("2"),
      INCOME("3");
  
      private String name;
      ContentTypes(String name) {
          this.name = name;
      }
      public String getName() {
          return name;
      }
  }
  
  public String getType(String type) {
      return (ContentTypes) type.getName();
  }
  </code></pre>
  
  <p>problem is <code>ContentTypes</code> contents are values. for example</p>
  
  <pre><code>String test = "FREE";
  getType(test);
  </code></pre>