Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to properly use TypeLiteral in GinMapBinder?
    primarykey
    data
    text
    <p>What im trying to do is to create map, where key will be class which extends my abstract class</p> <pre><code>GinMapBinder&lt;Class&lt;? extends Key&gt;, Value&gt; mapBinder = GinMapBinder .newMapBinder(binder(), new TypeLiteral&lt;Class&lt;? extends Key&gt;&gt;() { }, new TypeLiteral&lt;Value&gt;() { }); </code></pre> <p>but when i'm trying populate my map</p> <pre><code>mapBinder.addBinding(KeyImpl.class).to(Value.class); </code></pre> <p>i'm getting error: </p> <pre><code> Error injecting @com.google.gwt.inject.client.multibindings.Internal() java.lang.Class&lt;? extends my.test.gwt.gin.objects.Key&gt;: Unable to create or inherit binding: No implementation bound for '@com.google.gwt.inject.client.multibindings.Internal() java.lang.Class&lt;? extendsmy.test.gwt.gin.objects.Key&gt;' and an implicit binding cannot be created because the type is annotated. Path to required node: @com.google.gwt.inject.client.multibindings.Internal com.google.gwt.inject.client.multibindings.MapEntry&lt;java.lang.Class&lt;? extends my.test.gwt.gin.objects.Key&gt;, my.test.gwt.gin.objects.Value&gt; [com.google.gwt.inject.client.multibindings.BindingRecorder.bind(BindingRecorder.java:42)] -&gt; com.google.gwt.inject.client.multibindings.MapEntry&lt;java.lang.Class&lt;? extends my.test.gwt.gin.objects.Key&gt;, my.test.gwt.gin.objects.Value&gt; [com.google.gwt.inject.client.multibindings.BindingRecorder.bind(BindingRecorder.java:42)] -&gt; @com.google.gwt.inject.client.multibindings.Internal() java.lang.Class&lt;? extends my.test.gwt.gin.objects.Key&gt; [@Inject constructor of com.google.gwt.inject.client.multibindings.MapEntry&lt;java.lang.Class&lt;? extends my.test.gwt.gin.objects.Key&gt;, my.test.gwt.gin.objects.Value&gt;] </code></pre> <p>if i wont use <code>TypeLiteral</code>this will works, but i dont want class with raw type. So i'll be glad if anyone can help me to solve this issue. Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload