From: David ‘Bombe’ Roden Date: Tue, 5 Mar 2019 08:00:53 +0000 (+0100) Subject: 🎨 Replace Plugin containers with Kotlin versions X-Git-Tag: v79^2~85 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=50df1b89ec5ffdda556713c18e5e67365b84b41a;p=Sone.git 🎨 Replace Plugin containers with Kotlin versions --- diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 4b02d42..54e219f 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -408,46 +408,4 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr return getPluginVersion(); } - public static class PluginVersion { - - private final String version; - - public PluginVersion(String version) { - this.version = version; - } - - public String getVersion() { - return version; - } - - } - - public static class PluginYear { - - private final int year; - - public PluginYear(int year) { - this.year = year; - } - - public int getYear() { - return year; - } - - } - - public static class PluginHomepage { - - private final String homepage; - - public PluginHomepage(String homepage) { - this.homepage = homepage; - } - - public String getHomepage() { - return homepage; - } - - } - } diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.kt b/src/main/java/net/pterodactylus/sone/main/SonePlugin.kt new file mode 100644 index 0000000..5e0b2c1 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.kt @@ -0,0 +1,7 @@ +package net.pterodactylus.sone.main + +data class PluginVersion(val version: String) + +data class PluginYear(val year: Int) + +data class PluginHomepage(val homepage: String) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index e454406..b9faa86 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -72,11 +72,11 @@ import net.pterodactylus.sone.freenet.L10nFilter; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.Trust; import net.pterodactylus.sone.main.Loaders; +import net.pterodactylus.sone.main.PluginHomepage; +import net.pterodactylus.sone.main.PluginVersion; +import net.pterodactylus.sone.main.PluginYear; import net.pterodactylus.sone.main.ReparseFilter; import net.pterodactylus.sone.main.SonePlugin; -import net.pterodactylus.sone.main.SonePlugin.PluginHomepage; -import net.pterodactylus.sone.main.SonePlugin.PluginVersion; -import net.pterodactylus.sone.main.SonePlugin.PluginYear; import net.pterodactylus.sone.notify.ListNotification; import net.pterodactylus.sone.notify.ListNotificationFilter; import net.pterodactylus.sone.notify.PostVisibilityFilter; diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt index 29d941e..b55511a 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt @@ -1,8 +1,6 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.main.SonePlugin.PluginHomepage -import net.pterodactylus.sone.main.SonePlugin.PluginVersion -import net.pterodactylus.sone.main.SonePlugin.PluginYear +import net.pterodactylus.sone.main.* import net.pterodactylus.sone.web.WebInterface import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.util.template.Template diff --git a/src/test/java/net/pterodactylus/sone/web/AllPagesTest.kt b/src/test/java/net/pterodactylus/sone/web/AllPagesTest.kt index 9e395f2..ea28025 100644 --- a/src/test/java/net/pterodactylus/sone/web/AllPagesTest.kt +++ b/src/test/java/net/pterodactylus/sone/web/AllPagesTest.kt @@ -3,9 +3,7 @@ package net.pterodactylus.sone.web import com.google.inject.Guice.createInjector import net.pterodactylus.sone.core.Core import net.pterodactylus.sone.core.FreenetInterface -import net.pterodactylus.sone.main.SonePlugin.PluginHomepage -import net.pterodactylus.sone.main.SonePlugin.PluginVersion -import net.pterodactylus.sone.main.SonePlugin.PluginYear +import net.pterodactylus.sone.main.* import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.isProvidedByMock import net.pterodactylus.util.template.Template diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt index 45413d6..156b361 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt @@ -1,8 +1,6 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.main.SonePlugin.PluginHomepage -import net.pterodactylus.sone.main.SonePlugin.PluginVersion -import net.pterodactylus.sone.main.SonePlugin.PluginYear +import net.pterodactylus.sone.main.* import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.isProvidedByMock import net.pterodactylus.sone.web.baseInjector