From 5e214193f4775e15d17835f3bb032d2b439779ff Mon Sep 17 00:00:00 2001 From: Jikoo Date: Sun, 28 Jul 2024 10:22:30 -0400 Subject: [PATCH] Document public methods --- .../openinv/util/setting/PlayerToggles.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/src/main/java/com/lishid/openinv/util/setting/PlayerToggles.java b/api/src/main/java/com/lishid/openinv/util/setting/PlayerToggles.java index c3edbbf2..5a53b998 100644 --- a/api/src/main/java/com/lishid/openinv/util/setting/PlayerToggles.java +++ b/api/src/main/java/com/lishid/openinv/util/setting/PlayerToggles.java @@ -12,24 +12,48 @@ import java.util.Set; import java.util.UUID; +/** + * Utility class containing all of OpenInv's {@link PlayerToggle PlayerToggles}. + */ public final class PlayerToggles { private static final Map TOGGLES = new HashMap<>(); private static final PlayerToggle ANY = add(new MemoryToggle("anycontainer")); private static final PlayerToggle SILENT = add(new MemoryToggle("silentcontainer")); + /** + * Get the AnyContainer toggle. + * + * @return the AnyContainer toggle + */ public static @NotNull PlayerToggle any() { return ANY; } + /** + * Get the SilentContainer toggle. + * + * @return the SilentContainer toggle + */ public static @NotNull PlayerToggle silent() { return SILENT; } + /** + * Get a toggle by name. + * + * @param toggleName the name of the toggle + * @return the toggle, or null if no such toggle exists. + */ public static @Nullable PlayerToggle get(@NotNull String toggleName) { return TOGGLES.get(toggleName); } + /** + * Get an unmodifable view of all toggles available. + * + * @return a view of all toggles available + */ public static @UnmodifiableView @NotNull Collection get() { return Collections.unmodifiableCollection(TOGGLES.values()); }