title: How to implement enum with generics?
body: <p>I have a generic interface like this:</p>
  
  <pre><code>interface A&lt;T&gt; {
      T getValue();
  }
  </code></pre>
  
  <p>This interface has limited instances, hence it would be best to implement them as enum values. The problem is those instances have different type of values, so I tried the following approach but it does not compile:</p>
  
  <pre><code>public enum B implements A {
      A1&lt;String&gt; {
          @Override
          public String getValue() {
              return "value";
          }
      },
      A2&lt;Integer&gt; {
          @Override
          public Integer getValue() {
              return 0;
          }
      };
  }
  </code></pre>
  
  <p>Any idea about this?</p>