Reconstructing generic types at runtime with Guice via Types and TypeLiterals

前端 未结 2 1360
忘掉有多难
忘掉有多难 2021-01-06 19:52

I have a few types that are like this

// a value that is aware of its key type (K)
Bar
// something that deals with such values and keys
Foo

        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 20:55

    Guice's factory cannot build TypeVariable instances. You'll need to implement this interface directly as you need it.

    Note that Guice doesn't allow bindings for types that aren't fully-qualified. For example, you can bind a Map but you can't bind a Map.

提交回复
热议问题