[ https://issues.apache.org/jira/browse/KAFKA-4481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15716152#comment-15716152 ]
ASF GitHub Bot commented on KAFKA-4481: --------------------------------------- GitHub user xvrl opened a pull request: https://github.com/apache/kafka/pull/2205 KAFKA-4481: relax streams api type contraints Make appropriate methods contravariant in key and value types. You can merge this pull request into a Git repository by running: $ git pull https://github.com/xvrl/kafka streams-contravariance Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/2205.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2205 ---- commit 5ec27267d9714dd861b53e116cc1667c84ddcfd6 Author: Xavier Léauté <xav...@confluent.io> Date: 2016-12-02T19:50:36Z KAFKA-4481: relax streams api type contraints Make appropriate methods contravariant in key and value types. ---- > Relax Kafka Streams API type constraints > ---------------------------------------- > > Key: KAFKA-4481 > URL: https://issues.apache.org/jira/browse/KAFKA-4481 > Project: Kafka > Issue Type: Improvement > Components: streams > Reporter: Xavier Léauté > Assignee: Xavier Léauté > Labels: usability > > Streams API methods that apply transformations to streams are currently > invariant in the key and value types, when they should probably be > contravariant in those types. > For instance, {{KStream.filter(Predicate<K, V> predicate)}} should be > {{KStream.filter(Predicate<? super K, ? super V> predicate)}} to accept > predicates that can act on any supertype of K, or V. > Same thing applies to method that take {{Aggregator}}s, > {{StreamPartitioner}}s, {{KeyValueMapper}}s, {{ValueMapper}}s, > {{ProcessorSupplier}}s, {{ValueJoiner}}s, etc. -- This message was sent by Atlassian JIRA (v6.3.4#6332)