11/**
2- * Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3- */
2+ * Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
3+ */
44
55package com .lightbend .kafka .scala .streams
66
77import java .util .regex .Pattern
88
9- import ImplicitConversions ._
10- import org .apache .kafka .streams .kstream .{ GlobalKTable , Materialized }
9+ import com .lightbend .kafka .scala .streams .ImplicitConversions ._
10+ import org .apache .kafka .common .utils .Bytes
11+ import org .apache .kafka .streams .kstream .{GlobalKTable , Materialized }
1112import org .apache .kafka .streams .processor .{ProcessorSupplier , StateStore }
12- import org .apache .kafka .streams .state .{ StoreBuilder , KeyValueStore }
13+ import org .apache .kafka .streams .state .{KeyValueStore , StoreBuilder }
1314import org .apache .kafka .streams .{Consumed , StreamsBuilder , Topology }
14- import org .apache .kafka .common .utils .Bytes
1515
1616import scala .collection .JavaConverters ._
1717
1818/**
19- * Wraps the Java class StreamsBuilder and delegates method calls to the underlying Java object.
20- */
21- class StreamsBuilderS {
22-
23- val inner = new StreamsBuilder
19+ * Wraps the Java class StreamsBuilder and delegates method calls to the underlying Java object.
20+ */
21+ class StreamsBuilderS (inner : StreamsBuilder = new StreamsBuilder ) {
2422
25- def stream [K , V ](topic : String ) : KStreamS [K , V ] =
26- inner.stream[K , V ](topic)
23+ def stream [K , V ](topic : String ): KStreamS [K , V ] =
24+ inner.stream[K , V ](topic)
2725
28- def stream [K , V ](topic : String , consumed : Consumed [K , V ]) : KStreamS [K , V ] =
29- inner.stream[K , V ](topic, consumed)
26+ def stream [K , V ](topic : String , consumed : Consumed [K , V ]): KStreamS [K , V ] =
27+ inner.stream[K , V ](topic, consumed)
3028
31- def stream [K , V ](topics : List [String ]): KStreamS [K , V ] =
32- inner.stream[K , V ](topics.asJava)
29+ def stream [K , V ](topics : List [String ]): KStreamS [K , V ] =
30+ inner.stream[K , V ](topics.asJava)
3331
3432 def stream [K , V ](topics : List [String ], consumed : Consumed [K , V ]): KStreamS [K , V ] =
35- inner.stream[K , V ](topics.asJava, consumed)
33+ inner.stream[K , V ](topics.asJava, consumed)
3634
37- def stream [K , V ](topicPattern : Pattern ) : KStreamS [K , V ] =
35+ def stream [K , V ](topicPattern : Pattern ): KStreamS [K , V ] =
3836 inner.stream[K , V ](topicPattern)
3937
40- def stream [K , V ](topicPattern : Pattern , consumed : Consumed [K , V ]) : KStreamS [K , V ] =
38+ def stream [K , V ](topicPattern : Pattern , consumed : Consumed [K , V ]): KStreamS [K , V ] =
4139 inner.stream[K , V ](topicPattern, consumed)
4240
43- def table [K , V ](topic : String ) : KTableS [K , V ] = inner.table[K , V ](topic)
41+ def table [K , V ](topic : String ): KTableS [K , V ] = inner.table[K , V ](topic)
4442
45- def table [K , V ](topic : String , consumed : Consumed [K , V ]) : KTableS [K , V ] =
43+ def table [K , V ](topic : String , consumed : Consumed [K , V ]): KTableS [K , V ] =
4644 inner.table[K , V ](topic, consumed)
4745
4846 def table [K , V ](topic : String , consumed : Consumed [K , V ],
49- materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): KTableS [K , V ] =
50- inner.table[K , V ](topic, consumed, materialized)
47+ materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): KTableS [K , V ] =
48+ inner.table[K , V ](topic, consumed, materialized)
5149
52- def table [K , V ](topic : String ,
53- materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): KTableS [K , V ] =
50+ def table [K , V ](topic : String ,
51+ materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): KTableS [K , V ] =
5452 inner.table[K , V ](topic, materialized)
5553
5654 def globalTable [K , V ](topic : String ): GlobalKTable [K , V ] =
5755 inner.globalTable(topic)
5856
59- def globalTable [K , V ](topic : String , consumed : Consumed [K , V ]) : GlobalKTable [K , V ] =
60- inner.globalTable(topic, consumed)
57+ def globalTable [K , V ](topic : String , consumed : Consumed [K , V ]): GlobalKTable [K , V ] =
58+ inner.globalTable(topic, consumed)
6159
6260 def globalTable [K , V ](topic : String , consumed : Consumed [K , V ],
63- materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): GlobalKTable [K , V ] =
64- inner.globalTable(topic, consumed, materialized)
61+ materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): GlobalKTable [K , V ] =
62+ inner.globalTable(topic, consumed, materialized)
6563
66- def globalTable [K , V ](topic : String ,
67- materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): GlobalKTable [K , V ] =
68- inner.globalTable(topic, materialized)
64+ def globalTable [K , V ](topic : String ,
65+ materialized : Materialized [K , V , KeyValueStore [Bytes , Array [Byte ]]]): GlobalKTable [K , V ] =
66+ inner.globalTable(topic, materialized)
6967
7068 def addStateStore (builder : StoreBuilder [_ <: StateStore ]): StreamsBuilder = inner.addStateStore(builder)
7169
7270 def addGlobalStore (storeBuilder : StoreBuilder [_ <: StateStore ], topic : String , sourceName : String , consumed : Consumed [_, _], processorName : String , stateUpdateSupplier : ProcessorSupplier [_, _]): StreamsBuilder =
73- inner.addGlobalStore(storeBuilder,topic,sourceName,consumed,processorName,stateUpdateSupplier)
74-
75- def build () : Topology = inner.build()
76- }
77-
71+ inner.addGlobalStore(storeBuilder, topic, sourceName, consumed, processorName, stateUpdateSupplier)
7872
73+ def build (): Topology = inner.build()
74+ }
0 commit comments