From 1066319a0cedaa2c809c63c2c3cfadfbc7ce8dfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 24 Feb 2018 11:22:14 +0100 Subject: [PATCH] Replace some events with Kotlin versions --- .../sone/core/event/NewPostFoundEvent.java | 39 ---------------------- .../sone/core/event/NewPostReplyFoundEvent.java | 39 ---------------------- .../sone/core/event/PostRemovedEvent.java | 39 ---------------------- .../sone/core/event/PostReplyRemovedEvent.java | 39 ---------------------- .../sone/core/event/NewPostFoundEvent.kt | 30 +++++++++++++++++ .../sone/core/event/NewPostReplyFoundEvent.kt | 30 +++++++++++++++++ .../sone/core/event/PostRemovedEvent.kt | 30 +++++++++++++++++ .../sone/core/event/PostReplyRemovedEvent.kt | 30 +++++++++++++++++ 8 files changed, 120 insertions(+), 156 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/sone/core/event/NewPostFoundEvent.java delete mode 100644 src/main/java/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.java delete mode 100644 src/main/java/net/pterodactylus/sone/core/event/PostRemovedEvent.java delete mode 100644 src/main/java/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.java create mode 100644 src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt create mode 100644 src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.kt diff --git a/src/main/java/net/pterodactylus/sone/core/event/NewPostFoundEvent.java b/src/main/java/net/pterodactylus/sone/core/event/NewPostFoundEvent.java deleted file mode 100644 index ff81357..0000000 --- a/src/main/java/net/pterodactylus/sone/core/event/NewPostFoundEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Sone - NewPostFoundEvent.java - Copyright © 2013–2016 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 . - */ - -package net.pterodactylus.sone.core.event; - -import net.pterodactylus.sone.data.Post; - -/** - * Event that signals that a new post was found. - * - * @author David ‘Bombe’ Roden - */ -public class NewPostFoundEvent extends PostEvent { - - /** - * Creates a new “new post found” event. - * - * @param post - * The post that was found - */ - public NewPostFoundEvent(Post post) { - super(post); - } - -} diff --git a/src/main/java/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.java b/src/main/java/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.java deleted file mode 100644 index bda02b6..0000000 --- a/src/main/java/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Sone - NewPostReplyFoundEvent.java - Copyright © 2013–2016 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 . - */ - -package net.pterodactylus.sone.core.event; - -import net.pterodactylus.sone.data.PostReply; - -/** - * Event that signals that a new {@link PostReply} was found. - * - * @author David ‘Bombe’ Roden - */ -public class NewPostReplyFoundEvent extends PostReplyEvent { - - /** - * Creates a new “new post found” event. - * - * @param postReply - * The post reply that was found - */ - public NewPostReplyFoundEvent(PostReply postReply) { - super(postReply); - } - -} diff --git a/src/main/java/net/pterodactylus/sone/core/event/PostRemovedEvent.java b/src/main/java/net/pterodactylus/sone/core/event/PostRemovedEvent.java deleted file mode 100644 index 8240176..0000000 --- a/src/main/java/net/pterodactylus/sone/core/event/PostRemovedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Sone - PostRemovedEvent.java - Copyright © 2013–2016 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 . - */ - -package net.pterodactylus.sone.core.event; - -import net.pterodactylus.sone.data.Post; - -/** - * Event that signals that a {@link Post} was removed. - * - * @author David ‘Bombe’ Roden - */ -public class PostRemovedEvent extends PostEvent { - - /** - * Creates a new “post removed” event. - * - * @param post - * The post that was removed - */ - public PostRemovedEvent(Post post) { - super(post); - } - -} diff --git a/src/main/java/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.java b/src/main/java/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.java deleted file mode 100644 index 4f7cc8b..0000000 --- a/src/main/java/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Sone - PostReplyRemovedEvent.java - Copyright © 2013–2016 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 . - */ - -package net.pterodactylus.sone.core.event; - -import net.pterodactylus.sone.data.PostReply; - -/** - * Event that signals that a {@link PostReply} was removed. - * - * @author David ‘Bombe’ Roden - */ -public class PostReplyRemovedEvent extends PostReplyEvent { - - /** - * Creates a new “post reply removed” event. - * - * @param postReply - * The post reply that was removed - */ - public PostReplyRemovedEvent(PostReply postReply) { - super(postReply); - } - -} diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt new file mode 100644 index 0000000..6f8e851 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt @@ -0,0 +1,30 @@ +/* + * Sone - NewPostFoundEvent.java - Copyright © 2013–2016 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 . + */ + +package net.pterodactylus.sone.core.event + +import net.pterodactylus.sone.data.Post + +/** + * Event that signals that a new post was found. + */ +data class NewPostFoundEvent(val post: Post) { + + @Deprecated(message = "will go away", replaceWith = ReplaceWith("post")) + fun post() = post + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt new file mode 100644 index 0000000..c0d13a5 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt @@ -0,0 +1,30 @@ +/* + * Sone - NewPostReplyFoundEvent.java - Copyright © 2013–2016 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 . + */ + +package net.pterodactylus.sone.core.event + +import net.pterodactylus.sone.data.PostReply + +/** + * Event that signals that a new [PostReply] was found. + */ +data class NewPostReplyFoundEvent(val postReply: PostReply) { + + @Deprecated(message = "will go away", replaceWith = ReplaceWith("postReply")) + fun postReply() = postReply + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt new file mode 100644 index 0000000..896891f --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt @@ -0,0 +1,30 @@ +/* + * Sone - PostRemovedEvent.java - Copyright © 2013–2016 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 . + */ + +package net.pterodactylus.sone.core.event + +import net.pterodactylus.sone.data.Post + +/** + * Event that signals that a [Post] was removed. + */ +data class PostRemovedEvent(val post: Post) { + + @Deprecated(message = "will go away", replaceWith = ReplaceWith("post")) + fun post() = post + +} diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.kt new file mode 100644 index 0000000..8930f42 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/PostReplyRemovedEvent.kt @@ -0,0 +1,30 @@ +/* + * Sone - PostReplyRemovedEvent.java - Copyright © 2013–2016 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 . + */ + +package net.pterodactylus.sone.core.event + +import net.pterodactylus.sone.data.PostReply + +/** + * Event that signals that a [PostReply] was removed. + */ +data class PostReplyRemovedEvent(val postReply: PostReply) { + + @Deprecated(message = "will go away", replaceWith = ReplaceWith("postReply")) + fun postReply() = postReply + +} -- 2.7.4