🎨 Replace reply events with Kotlin versions
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Jun 2019 11:13:38 +0000 (13:13 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Jun 2019 11:44:06 +0000 (13:44 +0200)
src/main/java/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.java [deleted file]
src/main/java/net/pterodactylus/sone/core/event/PostReplyEvent.java [deleted file]
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/kotlin/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.kt [new file with mode: 0644]
src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyEvent.kt [new file with mode: 0644]

diff --git a/src/main/java/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.java b/src/main/java/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.java
deleted file mode 100644 (file)
index 4c0e2fc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Sone - MarkPostReplyKnownEvent.java - Copyright © 2013–2019 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.core.event;
-
-import net.pterodactylus.sone.data.PostReply;
-
-/**
- * Event that signals that a {@link PostReply} has been marked as
- * {@link PostReply#isKnown() known}.
- */
-public class MarkPostReplyKnownEvent extends PostReplyEvent {
-
-       /**
-        * Creates a new “post reply marked known” event.
-        *
-        * @param postReply
-        *            The post reply that was marked as known
-        */
-       public MarkPostReplyKnownEvent(PostReply postReply) {
-               super(postReply);
-       }
-
-}
diff --git a/src/main/java/net/pterodactylus/sone/core/event/PostReplyEvent.java b/src/main/java/net/pterodactylus/sone/core/event/PostReplyEvent.java
deleted file mode 100644 (file)
index e31870b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Sone - PostReplyEvent.java - Copyright © 2013–2019 David Roden
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.pterodactylus.sone.core.event;
-
-import net.pterodactylus.sone.data.PostReply;
-
-/**
- * Base class for {@link PostReply} events.
- */
-public class PostReplyEvent {
-
-       /** The post reply the event is about. */
-       private final PostReply postReply;
-
-       /**
-        * Creates a new post reply event.
-        *
-        * @param postReply
-        *            The post reply the event is about
-        */
-       protected PostReplyEvent(PostReply postReply) {
-               this.postReply = postReply;
-       }
-
-       //
-       // ACCESSORS
-       //
-
-       /**
-        * Returns the post reply the event is about.
-        *
-        * @return The post reply the event is about
-        */
-       public PostReply postReply() {
-               return postReply;
-       }
-
-}
index c78ad53..c50f74e 100644 (file)
@@ -844,7 +844,7 @@ public class WebInterface implements SessionProvider {
 
        @Subscribe
        public void markReplyKnown(MarkPostReplyKnownEvent markPostReplyKnownEvent) {
-               removeReply(markPostReplyKnownEvent.postReply());
+               removeReply(markPostReplyKnownEvent.getPostReply());
        }
 
        @Subscribe
diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/MarkPostReplyKnownEvent.kt
new file mode 100644 (file)
index 0000000..53d208d
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sone - MarkPostReplyKnownEvent.kt - Copyright © 2013–2019 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.core.event
+
+import net.pterodactylus.sone.data.*
+
+/**
+ * Event that signals that a [PostReply] has been marked as
+ * [known][PostReply.isKnown].
+ */
+class MarkPostReplyKnownEvent(postReply: PostReply) : PostReplyEvent(postReply)
diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyEvent.kt
new file mode 100644 (file)
index 0000000..5096207
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Sone - PostReplyEvent.kt - Copyright © 2013–2019 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.core.event
+
+import net.pterodactylus.sone.data.*
+
+/**
+ * Base class for [PostReply] events.
+ */
+open class PostReplyEvent(val postReply: PostReply)