Enum Class PermissionLevel

java.lang.Object
java.lang.Enum<PermissionLevel>
nl.pim16aap2.animatedarchitecture.core.structures.PermissionLevel
All Implemented Interfaces:
Serializable, Comparable<PermissionLevel>, Constable

public enum PermissionLevel extends Enum<PermissionLevel>
Represents a permission level where a lower level indicates a higher access level.
  • Enum Constant Details

  • Method Details

    • values

      public static PermissionLevel[] 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

      public static PermissionLevel valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromValue

      public static @Nullable PermissionLevel fromValue(int id)
      Retrieves the PermissionLevel mapped 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

      public static @Nullable PermissionLevel fromName(String name)
      Retrieves the PermissionLevel from 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

      public boolean isLowerThanOrEquals(PermissionLevel other)
      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

      public boolean isLowerThan(PermissionLevel other)
      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

      public static List<PermissionLevel> getValues()
      Retrieves an unmodifiable list of all values.

      See values().

      Returns:
      The values in this enum.
    • getValue

      public int getValue()
    • getTranslationKey

      public String getTranslationKey()