From: David ‘Bombe’ Roden Date: Sat, 24 Feb 2018 10:22:14 +0000 (+0100) Subject: Replace some events with Kotlin versions X-Git-Tag: v79^2~136 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1066319a0cedaa2c809c63c2c3cfadfbc7ce8dfa;p=Sone.git Replace some events with Kotlin versions --- 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 + +}