title: Java Generics Question: type parameter E is not within its bound
body: <p>i've got a question about generics. I have this method which does not compile at all. The compiler tells me: <code>type parameter E is not within its bound</code>. I've usually no problem in understanding compiler errors, but this one is quite tricky. Maybe my knowledge about generics need to improve. :-) Can anyone tell me whats wrong?</p>
  
  <pre><code>public static &lt;E extends Enum &amp; StringConvertableEnum&lt;E&gt;&gt; Map&lt;String, E&gt; map(Class&lt;E&gt; enumClass) {
      Map&lt;String, E&gt; mapping = new HashMap&lt;String, E&gt;();
  
      EnumSet&lt;E&gt; set = EnumSet.allOf(enumClass);
  
      for(E enumConstant : set) {
          mapping.put(enumConstant.getStringValue(), enumConstant);
      }
  
      return mapping;
  }
  </code></pre>
  
  <p>This is the definition of <code>StringConvertableEnum</code>:</p>
  
  <pre><code>public interface StringConvertableEnum&lt;E extends Enum&gt; {
      public E getEnumFromStringValue(String string);
      public String getStringValue();
  }
  </code></pre>