title: Mapping between an enum and a string?
body: <p>So, I recently read <a href="https://stackoverflow.com/questions/5021246/conveniently-map-between-enum-and-int-string">this post</a> and I want to do effectively the same thing.</p>
  
  <p>I didn't really care about "ugliness", etc. so I implemented one of the methods like so:</p>
  
  <pre><code>public enum Day {
  
      Monday(1), 
      Tuesday(2), 
      Wednesday(3), 
      Thursday(4), 
      Friday(5), 
      Saturday(6), 
      Sunday(7);
  
      public final int id;
  
      Day(int id) {
          this.id = id;
      }
  
      public static Day getByID(int id) {
          Day d = null;
          for (Day dTemp : Day.values())
          {
              if (id == dTemp)
              {
                  d = dTemp;
                  break;
              }
          }
  
          return d;
      }
  
      public Day getNext() {
          return values()[(ordinal()+1)%values().length];
      }
  
      public Day getPrev() {
          return values()[(ordinal()-1)%values().length];
      }
  }
  </code></pre>
  
  <p>But, the problem with it is in the if statement when I do:</p>
  
  <pre><code>if (id == dTemp)
  </code></pre>
  
  <p>It says that they are incompatible types. What should I do to fix it?</p>