I have a few types that are like this
// a value that is aware of its key type (K)
Bar<K>
// something that deals with such values and keys
Foo<V extends Bar<K>, K>
how would one recreate Foo such that you could consume it in guice? the bit I'm stuck on is how to cross reference the K from Bar to the 2nd parameterised type of Foo.
so for example
WildcardType kType = Types.subtypeOf(Object.class);
WildcardType barType = Types.subtypeOf(Types.newParameterizedType(Bar.class, pipeKey));
ParameterizedType fooType = Types.newParameterizedType(Foo.class, pipelineableType, pipeKey);
really this seems wrong as it's basically
Foo<V extends Bar<? extends Object>, ? extends Object>
which is not the same thing as
Foo<V extends Bar<K>, K>
as in the latter case I know that K is a consistent type.
Any ideas?
Cheers
Matt