@@ -37,7 +37,9 @@ abstract class EnrichedWithMetadata {
3737 }
3838}
3939
40- class Result (val value : Int = 0 )
40+ class Result (
41+ val value : Int = 0
42+ )
4143
4244class TestNonExistCommand : Command
4345
@@ -49,7 +51,9 @@ class NonExistQuery : Query<String>
4951 * Notifications
5052 */
5153
52- class TestNotification : Notification , EnrichedWithMetadata ()
54+ class TestNotification :
55+ EnrichedWithMetadata (),
56+ Notification
5357
5458class TestNotificationHandler (
5559 private val mediator : MediatorAccessor
@@ -60,7 +64,9 @@ class TestNotificationHandler(
6064 }
6165}
6266
63- open class Ping : Notification , EnrichedWithMetadata ()
67+ open class Ping :
68+ EnrichedWithMetadata (),
69+ Notification
6470
6571class ExtendedPing : Ping ()
6672
@@ -76,7 +82,9 @@ class AnotherPingHandler : NotificationHandler<Ping> {
7682 }
7783}
7884
79- class NotificationForMultipleHandlers : Notification , EnrichedWithMetadata ()
85+ class NotificationForMultipleHandlers :
86+ EnrichedWithMetadata (),
87+ Notification
8088
8189class Handler1ForNotificationOfMultipleHandlers : NotificationHandler <NotificationForMultipleHandlers > {
8290 override suspend fun handle (notification : NotificationForMultipleHandlers ) {
@@ -90,7 +98,9 @@ class Handler2ForNotificationOfMultipleHandlers : NotificationHandler<Notificati
9098 }
9199}
92100
93- class PingForInherited : Notification , EnrichedWithMetadata ()
101+ class PingForInherited :
102+ EnrichedWithMetadata (),
103+ Notification
94104
95105abstract class NotificationHandlerBase <TNotification : Notification > : NotificationHandler <TNotification >
96106
@@ -100,7 +110,10 @@ class InheritedNotificationHandler : NotificationHandlerBase<PingForInherited>()
100110 }
101111}
102112
103- class ParameterizedNotification <T >(val param : T ) : Notification, EnrichedWithMetadata()
113+ class ParameterizedNotification <T >(
114+ val param : T
115+ ) : EnrichedWithMetadata(),
116+ Notification
104117
105118class ParameterizedNotificationHandler <A > : NotificationHandler <ParameterizedNotification <A >> {
106119 override suspend fun handle (notification : ParameterizedNotification <A >) {
@@ -109,7 +122,10 @@ class ParameterizedNotificationHandler<A> : NotificationHandler<ParameterizedNot
109122 }
110123}
111124
112- class ParameterizedNotificationForInheritance <T >(val param : T ) : Notification, EnrichedWithMetadata()
125+ class ParameterizedNotificationForInheritance <T >(
126+ val param : T
127+ ) : EnrichedWithMetadata(),
128+ Notification
113129
114130class ParameterizedNotificationHandlerForInheritance <T > : NotificationHandlerBase <ParameterizedNotificationForInheritance <T >>() {
115131 override suspend fun handle (notification : ParameterizedNotificationForInheritance <T >) {
@@ -122,15 +138,19 @@ class ParameterizedNotificationHandlerForInheritance<T> : NotificationHandlerBas
122138 * Commands
123139 */
124140
125- class TestCommandForWithoutInjection : Command , EnrichedWithMetadata ()
141+ class TestCommandForWithoutInjection :
142+ EnrichedWithMetadata (),
143+ Command
126144
127145class TestCommandHandlerWithoutInjection : CommandHandler <TestCommandForWithoutInjection > {
128146 override suspend fun handle (command : TestCommandForWithoutInjection ) {
129147 command.incrementInvocationCount()
130148 }
131149}
132150
133- class TestCommand : Command , EnrichedWithMetadata ()
151+ class TestCommand :
152+ EnrichedWithMetadata (),
153+ Command
134154
135155class TestCommandHandler (
136156 private val mediator : MediatorAccessor
@@ -141,9 +161,14 @@ class TestCommandHandler(
141161 }
142162}
143163
144- data class TestCommandWithResult (val invoked : Int = 0 ) : CommandWithResult<Result>, EnrichedWithMetadata()
164+ data class TestCommandWithResult (
165+ val invoked : Int = 0
166+ ) : EnrichedWithMetadata(),
167+ CommandWithResult <Result >
145168
146- class TestCommandWithResultCommandHandler (val mediator : MediatorAccessor ) : CommandWithResultHandler<TestCommandWithResult, Result> {
169+ class TestCommandWithResultCommandHandler (
170+ val mediator : MediatorAccessor
171+ ) : CommandWithResultHandler<TestCommandWithResult, Result> {
147172 override suspend fun handle (
148173 command : TestCommandWithResult
149174 ): Result = Result (command.invoked + 1 ).also {
@@ -153,8 +178,8 @@ class TestCommandWithResultCommandHandler(val mediator: MediatorAccessor) : Comm
153178}
154179
155180class CommandThatPassesThroughPipelineBehaviours :
156- Command ,
157181 EnrichedWithMetadata (),
182+ Command ,
158183 CanPassLoggingPipelineBehaviour ,
159184 CanPassExceptionPipelineBehaviour ,
160185 CanPassInheritedPipelineBehaviour
@@ -169,8 +194,8 @@ class TestPipelineCommandHandler(
169194}
170195
171196class CommandForWithoutInjectionThatPassesThroughPipelineBehaviours :
172- Command ,
173197 EnrichedWithMetadata (),
198+ Command ,
174199 CanPassLoggingPipelineBehaviour ,
175200 CanPassExceptionPipelineBehaviour ,
176201 CanPassInheritedPipelineBehaviour
@@ -181,7 +206,9 @@ class TestPipelineCommandHandlerWithoutInjection : CommandHandler<CommandForWith
181206 }
182207}
183208
184- class CommandThatFailsWhilePassingThroughPipelineBehaviours : Command , EnrichedWithMetadata ()
209+ class CommandThatFailsWhilePassingThroughPipelineBehaviours :
210+ EnrichedWithMetadata (),
211+ Command
185212
186213class TestPipelineCommandHandlerThatFails : CommandHandler <CommandThatFailsWhilePassingThroughPipelineBehaviours > {
187214 override suspend fun handle (command : CommandThatFailsWhilePassingThroughPipelineBehaviours ) {
@@ -190,7 +217,9 @@ class TestPipelineCommandHandlerThatFails : CommandHandler<CommandThatFailsWhile
190217 }
191218}
192219
193- class TestCommandThatFailsWithException : Command , EnrichedWithMetadata ()
220+ class TestCommandThatFailsWithException :
221+ EnrichedWithMetadata (),
222+ Command
194223
195224class TestBrokenCommandHandler (
196225 private val mediator : MediatorAccessor
@@ -202,7 +231,9 @@ class TestBrokenCommandHandler(
202231 }
203232}
204233
205- class TestCommandForInheritance : Command , EnrichedWithMetadata ()
234+ class TestCommandForInheritance :
235+ EnrichedWithMetadata (),
236+ Command
206237
207238abstract class MyCommandHandlerBaseForSpecificCommand : CommandHandler <TestCommandForInheritance >
208239
@@ -212,7 +243,9 @@ class TestInheritedCommandHandlerForSpecificCommand : MyCommandHandlerBaseForSpe
212243 }
213244}
214245
215- class TestCommandForTypeLimitedInheritance : Command , EnrichedWithMetadata ()
246+ class TestCommandForTypeLimitedInheritance :
247+ EnrichedWithMetadata (),
248+ Command
216249
217250abstract class TestBaseCommandHandlerForTypeLimitedInheritance <TCommand : Command > : CommandHandler <TCommand >
218251
@@ -223,7 +256,10 @@ class TestCommandHandlerForTypeLimitedInheritance :
223256 }
224257}
225258
226- class ParameterizedCommand <T >(val param : T ) : Command, EnrichedWithMetadata()
259+ class ParameterizedCommand <T >(
260+ val param : T
261+ ) : EnrichedWithMetadata(),
262+ Command
227263
228264class ParameterizedCommandHandler <T > : CommandHandler <ParameterizedCommand <T >> {
229265 override suspend fun handle (command : ParameterizedCommand <T >) {
@@ -232,7 +268,10 @@ class ParameterizedCommandHandler<T> : CommandHandler<ParameterizedCommand<T>> {
232268 }
233269}
234270
235- class ParameterizedCommandForInheritedCommandHandler <T >(val param : T ) : Command, EnrichedWithMetadata()
271+ class ParameterizedCommandForInheritedCommandHandler <T >(
272+ val param : T
273+ ) : EnrichedWithMetadata(),
274+ Command
236275
237276abstract class ParameterizedCommandHandlerBaseForInheritedCommandHandler <A > :
238277 CommandHandler <ParameterizedCommandForInheritedCommandHandler <A >>
@@ -247,7 +286,8 @@ class ParameterizedCommandHandlerForInheritance<A> : ParameterizedCommandHandler
247286class ParameterizedCommandWithResult <TParam , TReturn >(
248287 val param : TParam ,
249288 val retFn : suspend (TParam ) -> TReturn
250- ) : CommandWithResult<TReturn>, EnrichedWithMetadata()
289+ ) : EnrichedWithMetadata(),
290+ CommandWithResult <TReturn >
251291
252292class ParameterizedCommandWithResultHandler <TParam , TReturn > :
253293 CommandWithResultHandler <ParameterizedCommandWithResult <TParam , TReturn >, TReturn > {
@@ -258,7 +298,10 @@ class ParameterizedCommandWithResultHandler<TParam, TReturn> :
258298 }
259299}
260300
261- data class ParameterizedCommandWithResultForInheritance <TParam >(val param : TParam ) : CommandWithResult<String>, EnrichedWithMetadata()
301+ data class ParameterizedCommandWithResultForInheritance <TParam >(
302+ val param : TParam
303+ ) : EnrichedWithMetadata(),
304+ CommandWithResult <String >
262305
263306abstract class ParameterizedCommandWithResultHandlerBase <TParam : CommandWithResult <String >> : CommandWithResultHandler <TParam , String >
264307
@@ -275,7 +318,10 @@ class ParameterizedCommandWithResultHandlerOfInheritedHandler<TParam> :
275318 * Queries
276319 */
277320
278- class TestQuery (val id : Int ) : Query<String>, EnrichedWithMetadata()
321+ class TestQuery (
322+ val id : Int
323+ ) : EnrichedWithMetadata(),
324+ Query <String >
279325
280326class TestQueryHandler (
281327 private val mediator : MediatorAccessor
@@ -290,7 +336,8 @@ class TestQueryHandler(
290336class ParameterizedQuery <TParam , TResponse >(
291337 val param : TParam ,
292338 val retFn : suspend (TParam ) -> TResponse
293- ) : Query<TResponse>, EnrichedWithMetadata()
339+ ) : EnrichedWithMetadata(),
340+ Query <TResponse >
294341
295342class ParameterizedQueryHandler <TParam , TResponse > : QueryHandler <ParameterizedQuery <TParam , TResponse >, TResponse > {
296343 override suspend fun handle (query : ParameterizedQuery <TParam , TResponse >): TResponse {
@@ -360,11 +407,20 @@ class InheritedPipelineBehaviour : MyBasePipelineBehaviour() {
360407
361408interface OrderedPipelineUseCase
362409
363- class CommandThatPassesThroughOrderedPipelineBehaviours : Command , EnrichedWithMetadata (), OrderedPipelineUseCase
410+ class CommandThatPassesThroughOrderedPipelineBehaviours :
411+ EnrichedWithMetadata (),
412+ Command ,
413+ OrderedPipelineUseCase
364414
365- class QueryThatPassesThroughOrderedPipelineBehaviours : Query <String >, EnrichedWithMetadata (), OrderedPipelineUseCase
415+ class QueryThatPassesThroughOrderedPipelineBehaviours :
416+ EnrichedWithMetadata (),
417+ Query <String >,
418+ OrderedPipelineUseCase
366419
367- class NotificationThatPassesThroughOrderedPipelineBehaviours : Notification , EnrichedWithMetadata (), OrderedPipelineUseCase
420+ class NotificationThatPassesThroughOrderedPipelineBehaviours :
421+ EnrichedWithMetadata (),
422+ Notification ,
423+ OrderedPipelineUseCase
368424
369425class CommandHandlerThatPassesThroughOrderedPipelineBehaviours : CommandHandler <CommandThatPassesThroughOrderedPipelineBehaviours > {
370426 override suspend fun handle (command : CommandThatPassesThroughOrderedPipelineBehaviours ) {
0 commit comments