title: Java Enum return Int
body: <p>I'm having trouble declaring an enum. What I'm trying to create is an enum for a 'DownloadType', where there are 3 download types (AUDIO, VIDEO, AUDIO_AND_VIDEO).</p>
  
  <p>I have implemented the code as follows:</p>
  
  <pre><code>private enum DownloadType {
      AUDIO(0), VIDEO(1), AUDIO_AND_VIDEO(2);
      private final int value;
  
      private DownloadType(int value) {
          this.value = value;
      }
  }
  </code></pre>
  
  <p>This works fine if I then use it like this:</p>
  
  <pre><code>DownloadType.AUDIO_AND_VIDEO.value;
  </code></pre>
  
  <p>However, I would like it so that I don't have to ask for the 'value'. I may be mistaken, but this is the way several classes work in Java such as Font, for example to set a font style, you use:</p>
  
  <pre><code>Font.PLAIN
  </code></pre>
  
  <p>Which returns an int value, we don't use:</p>
  
  <pre><code>Font.PLAIN.value
  </code></pre>