🎨 Replace Plugin containers with Kotlin versions
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Mar 2019 08:00:53 +0000 (09:00 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Mar 2019 14:20:56 +0000 (15:20 +0100)
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
src/main/java/net/pterodactylus/sone/main/SonePlugin.kt [new file with mode: 0644]
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt
src/test/java/net/pterodactylus/sone/web/AllPagesTest.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt

index 4b02d42..54e219f 100644 (file)
@@ -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 (file)
index 0000000..5e0b2c1
--- /dev/null
@@ -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)
index e454406..b9faa86 100644 (file)
@@ -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;
index 29d941e..b55511a 100644 (file)
@@ -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
index 9e395f2..ea28025 100644 (file)
@@ -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
index 45413d6..156b361 100644 (file)
@@ -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