Class CommandPermission

java.lang.Object
dev.jorel.commandapi.CommandPermission

public class CommandPermission extends Object
A representation of permission nodes for commands. Represents permission nodes, being op and having all permissions
  • Field Details

    • NONE

      public static final CommandPermission NONE
      Command can be run with no permissions
    • OP

      public static final CommandPermission OP
      A player that has to be an operator to run a command
  • Method Details

    • fromString

      public static CommandPermission fromString(String permission)
      Generates a new CommandPermission from a permission node
      Parameters:
      permission - the permission node
      Returns:
      a new CommandPermission
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a human-readable string of this CommandPermission
      Overrides:
      toString in class Object
      Returns:
      a human-readable string of this CommandPermission
    • getPermission

      public Optional<String> getPermission()
      Returns the custom permission in string form if set
      Returns:
      An Optional<String> with the custom permission or an empty Optional if not set
    • isNegated

      public boolean isNegated()
      Returns if the permission is negated
      Returns:
      the permission's negation state