From 18a45f362d69085b12fe3028e9320578e10cc968 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 13 Nov 2016 11:52:42 +0100 Subject: [PATCH] Move enum to more appropriate class --- .../java/net/pterodactylus/sone/core/Core.java | 2 +- .../java/net/pterodactylus/sone/data/Sone.java | 24 ------------------- .../net/pterodactylus/sone/data/SoneOptions.java | 28 +++++++++++++++++++--- .../sone/template/ProfileAccessor.java | 2 +- .../net/pterodactylus/sone/web/OptionsPage.java | 2 +- 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 91825a6..42542c0 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -68,8 +68,8 @@ import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Profile.Field; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.data.Sone.ShowCustomAvatars; import net.pterodactylus.sone.data.Sone.SoneStatus; +import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars; import net.pterodactylus.sone.data.TemporaryImage; import net.pterodactylus.sone.database.AlbumBuilder; import net.pterodactylus.sone.database.Database; diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 68c8114..777660f 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -69,30 +69,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable { downloading, } - /** - * The possible values for the “show custom avatars” option. - * - * @author David ‘Bombe’ Roden - */ - public static enum ShowCustomAvatars { - - /** Never show custom avatars. */ - NEVER, - - /** Only show custom avatars of followed Sones. */ - FOLLOWED, - - /** Only show custom avatars of Sones you manually trust. */ - MANUALLY_TRUSTED, - - /** Only show custom avatars of automatically trusted Sones. */ - TRUSTED, - - /** Always show custom avatars. */ - ALWAYS, - - } - /** comparator that sorts Sones by their nice name. */ public static final Comparator NICE_NAME_COMPARATOR = new Comparator() { diff --git a/src/main/java/net/pterodactylus/sone/data/SoneOptions.java b/src/main/java/net/pterodactylus/sone/data/SoneOptions.java index 819e94a..4abf16f 100644 --- a/src/main/java/net/pterodactylus/sone/data/SoneOptions.java +++ b/src/main/java/net/pterodactylus/sone/data/SoneOptions.java @@ -1,8 +1,6 @@ package net.pterodactylus.sone.data; -import static net.pterodactylus.sone.data.Sone.ShowCustomAvatars.NEVER; - -import net.pterodactylus.sone.data.Sone.ShowCustomAvatars; +import static net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars.NEVER; /** * All Sone-specific options. @@ -30,6 +28,30 @@ public interface SoneOptions { void setShowCustomAvatars(ShowCustomAvatars showCustomAvatars); /** + * The possible values for the “show custom avatars” option. + * + * @author David ‘Bombe’ Roden + */ + enum ShowCustomAvatars { + + /** Never show custom avatars. */ + NEVER, + + /** Only show custom avatars of followed Sones. */ + FOLLOWED, + + /** Only show custom avatars of Sones you manually trust. */ + MANUALLY_TRUSTED, + + /** Only show custom avatars of automatically trusted Sones. */ + TRUSTED, + + /** Always show custom avatars. */ + ALWAYS, + + } + + /** * {@link SoneOptions} implementation. * * @author David ‘Bombe’ Roden diff --git a/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java b/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java index 980d960..7362179 100644 --- a/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java @@ -20,7 +20,7 @@ package net.pterodactylus.sone.template; import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.data.Sone.ShowCustomAvatars; +import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars; import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.freenet.wot.Trust; import net.pterodactylus.util.template.Accessor; diff --git a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java index 2bd1bfd..ae1dcc3 100644 --- a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java +++ b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java @@ -24,7 +24,7 @@ import java.util.List; import net.pterodactylus.sone.core.Preferences; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.data.Sone.ShowCustomAvatars; +import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars; import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; -- 2.7.4