Java Generic confusion on wild card
<p>I am learning generic and got struck at some point.here is my class </p>

<pre><code>public class MyValidator{

    private Class providerClass;

    public MyValidator(Container container){
       setProviderClass(container.getInstanc(ValidationProvider.class),"my.providerClass");
   }

    public void setProviderClass(Class&lt;? extends ValidationProvider&gt; providerClass)
    {
        this.providerClass = providerClass;
    }

}
</code></pre>

<p>Signature of container is </p>

<pre><code> &lt;T&gt; T getInstance(Class&lt;T&gt; type, String name)
Gets an instance of the given dependency which was declared in ContainerBuilder.
</code></pre>

<p>Container is an inbuild DI mechanism of the platform i am using, but when i call the setter method from inside my constructor i am getting following exception in Eclipse</p>

<blockquote>
  <p>The method setProviderClass(Class) in the type MyValidator is not applicable for the arguments (ValidationProvider)</p>
</blockquote>

<p>I know i am not following the contract properly but not sure how to do this.My intentions are to set the class at run time and it should accept all those implimentation who impliments <code>ValidationProvider</code> which is an interface.</p>
