From 50df1b89ec5ffdda556713c18e5e67365b84b41a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 5 Mar 2019 09:00:53 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=8E=A8=20Replace=20Plugin=20containers=20w?= =?utf8?q?ith=20Kotlin=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../net/pterodactylus/sone/main/SonePlugin.java | 42 ---------------------- .../java/net/pterodactylus/sone/main/SonePlugin.kt | 7 ++++ .../net/pterodactylus/sone/web/WebInterface.java | 6 ++-- .../net/pterodactylus/sone/web/pages/AboutPage.kt | 4 +-- .../net/pterodactylus/sone/web/AllPagesTest.kt | 4 +-- .../pterodactylus/sone/web/pages/AboutPageTest.kt | 4 +-- 6 files changed, 13 insertions(+), 54 deletions(-) create mode 100644 src/main/java/net/pterodactylus/sone/main/SonePlugin.kt 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 -- 2.7.4