Enum Class PermissionLevel
- All Implemented Interfaces:
Serializable, Comparable<PermissionLevel>, Constable
Represents a permission level where a lower level indicates a higher access level.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable PermissionLevelRetrieves thePermissionLevelfrom its name.static @Nullable PermissionLevelfromValue(int id) Retrieves thePermissionLevelmapped to a given id.intgetValue()static List<PermissionLevel> Retrieves an unmodifiable list of all values.booleanisLowerThan(PermissionLevel other) Checks if the current permission is lower than other permission level.booleanChecks if the current permission is lower than or equal to the other permission level.static PermissionLevelReturns the enum constant of this class with the specified name.static PermissionLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CREATOR
-
ADMIN
-
USER
-
NO_PERMISSION
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromValue
Retrieves thePermissionLevelmapped to a given id.- Parameters:
id- The id of the structure permission to retrieve.- Returns:
- The structure permission with the given id if it exists, otherwise null.
-
fromName
Retrieves thePermissionLevelfrom its name.This method is case-insensitive.
- Parameters:
name- The name of the structure permission to retrieve.- Returns:
- The structure permission with the given name if it exists, otherwise null.
-
isLowerThanOrEquals
Checks if the current permission is lower than or equal to the other permission level.- Parameters:
other- The other permission level to compare against.- Returns:
- True if the current permission level is lower than or equal to the other permission level, otherwise false.
-
isLowerThan
Checks if the current permission is lower than other permission level.- Parameters:
other- The other permission level to compare against.- Returns:
- True if the current permission level is lower than the other permission level, otherwise false.
-
getValues
Retrieves an unmodifiable list of all values.See
values().- Returns:
- The values in this enum.
-
getValue
public int getValue() -
getTranslationKey
-