The only way this is workable is if you subclass StringObjectKeyValueStore
:
class FriendStore extends StringObjectKeyValueStore<Friend>{}
The you can resolve V
for a particular type, such as KeyValueStore
, using TypeTools (which I authored):
Class<?> v = TypeResolver.resolveRawArguments(KeyValueStore.class, FriendStore.class)[1];assert v == Friend.class;