Fix generics for Grouped
Reviewers: Andrew Choi John Roesler
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.kafka.streams.kstream;
-
import org.apache.kafka.common.serialization.Serde;
/**
@@ -35,7 +33,6 @@ public class Grouped<K, V> implements NamedOperation<Grouped<K, V>> {
protected final Serde<V> valueSerde;
protected final String name;
-
private Grouped(final String name,
final Serde<K> keySerde,
final Serde<V> valueSerde) {
@@ -71,7 +68,7 @@ public class Grouped<K, V> implements NamedOperation<Grouped<K, V>> {
* @see KStream#groupBy(KeyValueMapper, Grouped)
* @see KTable#groupBy(KeyValueMapper, Grouped)
*/
- public static <K> Grouped keySerde(final Serde<K> keySerde) {
+ public static <K, V> Grouped<K, V> keySerde(final Serde<K> keySerde) {
return new Grouped<>(null, keySerde, null);
}
@@ -85,7 +82,7 @@ public class Grouped<K, V> implements NamedOperation<Grouped<K, V>> {
* @see KStream#groupBy(KeyValueMapper, Grouped)
* @see KTable#groupBy(KeyValueMapper, Grouped)
*/
- public static <V> Grouped valueSerde(final Serde<V> valueSerde) {
+ public static <K, V> Grouped<K, V> valueSerde(final Serde<V> valueSerde) {
return new Grouped<>(null, null, valueSerde);
}
