[ https://issues.apache.org/jira/browse/KAFKA-4481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15716140#comment-15716140 ]
Xavier Léauté commented on KAFKA-4481: -------------------------------------- This change should be backwards-compatible and would only affect someone extending or re-implementing kafka streams interfaces. > 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)