Class ChecksContainer
java.lang.Object
studio.thevipershow.safechat.api.checks.ChecksContainer
public final class ChecksContainer
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Check>
CHECK_PRIORITY_COMPARATOR
-
Constructor Summary
Constructors Constructor Description ChecksContainer(@NotNull SafeChat safeChat)
-
Method Summary
Modifier and Type Method Description @NotNull java.util.Collection<Check>
getActiveChecks()
Get all of the active checks.static ChecksContainer
getInstance()
Get the instance of the ChecksContainer.static ChecksContainer
getInstance(SafeChat safeChat)
boolean
register(@NotNull Check check)
Register a check if it wasn't.boolean
unregister(@NotNull Check check)
Unregister a check if it is currently loaded.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
CHECK_PRIORITY_COMPARATOR
-
-
Constructor Details
-
ChecksContainer
-
-
Method Details
-
getInstance
-
getInstance
Get the instance of the ChecksContainer. This method should have rigid checks before being called, The SafeChat plugin DEMANDS to be loaded in order for this method to return the instance successfully.- Returns:
- The ChecksContainer if available.
- Throws:
java.lang.UnsupportedOperationException
- If SafeChat wasn't loaded yet.
-
register
Register a check if it wasn't.- Parameters:
check
- The check.
-
unregister
Unregister a check if it is currently loaded.- Parameters:
check
- The check.- Returns:
- True if it has been unregistered, false otherwise.
-
getActiveChecks
Get all of the active checks. The checks are returned ordered by their priority.- Returns:
- The active checks.
-