Why is the net-mail subscriber of the signature of the future return type <? super v>

Method signature addListenerforio.netty.util.concurrent.Promise<V>

Promise<V> addListener(GenericFutureListener<? extends Future<? super V>> listener)

Please explain why the argument is not type GenericFutureListener<? extends Future<? extends V>> because it seems that the result of the promise should be Veither its subclasses, but not its superclasses.

But why is the return type of the future <? super V>?

+4
source share
1 answer

Here we need something that we can listen Vto at least. He might be able to listen more, but that would not be enough if he could only listen to a subclass V.

, AnimalMammalDog, Listener Mammal, Listener Animal , Listener a Dog , my Mammal Cat.

+4

Source: https://habr.com/ru/post/1589148/


All Articles