Skip to content

Commit

Permalink
Document public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikoo committed Jul 28, 2024
1 parent 8ca6a01 commit 5e21419
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, PlayerToggle> 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<PlayerToggle> get() {
return Collections.unmodifiableCollection(TOGGLES.values());
}
Expand Down

0 comments on commit 5e21419

Please sign in to comment.