Interface Permission

All Known Subinterfaces:
PredicatePermission<C>
All Known Implementing Classes:
AndPermission, OrPermission

@Immutable @API(status=STABLE) public interface Permission
A command permission representation.

The meaning of a permission is dependent on the platform, and the same permission node may represent different things in different environments.

See Also:
  • Field Details

  • Method Details

    • permission

      static @NonNull Permission permission(@NonNull String permission)
      Returns a simple permission that is represented by the given permission string.
      Parameters:
      permission - permission string
      Returns:
      the permission
    • of

      static @NonNull Permission of(@NonNull String permission)
      Returns a simple permission that is represented by the given permission string.
      Parameters:
      permission - permission string
      Returns:
      the permission
    • empty

      static @NonNull Permission empty()
      Returns an empty permission node.
      Returns:
      an empty permission node
    • allOf

      Creates a new AND permission that evaluates to true if all the given permissions evaluate to true.
      Parameters:
      permissions - permissions to join
      Returns:
      the permission
    • allOf

      static @NonNull Permission allOf(@NonNull Permission @NonNull ... permissions)
      Creates a new AND permission that evaluates to true if all the given permissions evaluate to true.
      Parameters:
      permissions - permissions to join
      Returns:
      the permission
    • anyOf

      Create a new OR permission that evaluates to true if any of the given permissions evaluates to true.
      Parameters:
      permissions - permissions to join
      Returns:
      the permission
    • anyOf

      static @NonNull Permission anyOf(@NonNull Permission @NonNull ... permissions)
      Create a new OR permission that evaluates to true if any of the given permissions evaluates to true.
      Parameters:
      permissions - permissions to join
      Returns:
      the permission
    • permissions

      default @NonNull Collection<@NonNull Permission> permissions()
      Returns the inner permission nodes of this node.
      Returns:
      the inner permission nodes
    • permissionString

      @NonNull String permissionString()
      Returns the string representation of the permission.
      Returns:
      string representation
    • isEmpty

      @API(status=STABLE) default boolean isEmpty()
      Returns true if a check for this permission should and will always return true.
      Returns:
      true if this permission is empty, otherwise false
    • or

      Returns a permission that matches either this permission or the other permission.
      Parameters:
      other - the other permission to test
      Returns:
      a new or permission
    • or

      Returns a permission that matches either this permission or any of the other permissions.
      Parameters:
      other - the other permission to test
      Returns:
      a new or permission
    • and

      Returns a permission that matches this permission and the other permission.
      Parameters:
      other - the other permission to test
      Returns:
      a new and permission
    • and

      Returns a permission that matches this permission and all of the other permissions.
      Parameters:
      other - the other permission to test
      Returns:
      a new and permission