title: Spring: How do I inject ENUM in Spring configuration with generics?
body: <p>I have a class like this : </p>
  
  <pre class="lang-spring prettyprint-override"><code>public class CheckSetFilter&lt;E extends Enum&lt;E&gt;&gt; 
  {
     public CheckSetFilter(CheckSetManager&lt;E&gt; pCheckSetManager, E pCheckSetId)
  }
  </code></pre>
  
  <p>I have this enum : </p>
  
  <pre class="lang-spring prettyprint-override"><code>public enum StubCheckId
  {
     STUBCHECK1, STUBCHECK2
  }
  </code></pre>
  
  <p>I try to create such an object with Spring : </p>
  
  <pre class="lang-spring prettyprint-override"><code>&lt;bean id="checkSetFilter" class="com.iba.icomp.core.checks.CheckSetFilter"&gt;
     &lt;constructor-arg ref="checkSetManager"/&gt;
     &lt;constructor-arg value="STUBCHECK1"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>It complains, it cannot convert from String to Enum. I guess this is because of the generic. It cannot know the type of enum to create. I also tried to give it a type hint, but no luck.</p>