Skip to content

Commit 0397680

Browse files
Deprecate NothingHappened in favor of NoReaction
We cannot say "nothing happened" in response to an event, because something indeed happened. So, `NoReaction` is a better way of describing the case when we do not want to react on an event.
1 parent fbee4ad commit 0397680

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

server/src/main/kotlin/io/spine/server/event/Policy.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ import io.spine.string.joinBackticked
6666
* from your Kotlin method, or `Just.nothing()` from Java.
6767
*
6868
* If you need to avoid the naming collision with [kotlin.Nothing], consider using
69-
* type aliases [NothingHappened][io.spine.server.model.NothingHappened] or
70-
* [NoReaction][io.spine.server.model.NoReaction].
69+
* the [NoReaction][io.spine.server.model.NoReaction] type alias.
7170
*
7271
* ### Returning one event
7372
* To return one event, declare `Just<MyEvent>` as the return type of the [whenever] method.
@@ -91,7 +90,6 @@ import io.spine.string.joinBackticked
9190
* @see [io.spine.server.tuple.Quartet]
9291
* @see [io.spine.server.tuple.Quintet]
9392
* @see [io.spine.server.model.Nothing]
94-
* @see [io.spine.server.model.NothingHappened]
9593
* @see [io.spine.server.model.NoReaction]
9694
*/
9795
public abstract class Policy<E : EventMessage> : AbstractEventReactor(), WithLogging {

server/src/main/kotlin/io/spine/server/model/EventExts.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ package io.spine.server.model
3030
* The alias for cases of naming collisions between
3131
* [io.spine.server.model.Nothing] and [kotlin.Nothing].
3232
*/
33+
@Deprecated(message = "Please use `NoReaction` instead", replaceWith = ReplaceWith("NoReaction"))
3334
public typealias NothingHappened = Nothing
3435

3536
/**

0 commit comments

Comments
 (0)