Interface PredicatePermission<C>

Type Parameters:
C - command sender type
All Superinterfaces:
CloudKeyHolder<Void>, Permission
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE) public interface PredicatePermission<C> extends Permission, CloudKeyHolder<Void>
A functional Permission implementation
  • Method Details

    • of

      static <C> PredicatePermission<C> of(@NonNull CloudKey<Void> key, @NonNull Predicate<C> predicate)
      Creates a new predicate permission
      Type Parameters:
      C - command sender type
      Parameters:
      key - key that identifies the permission node
      predicate - predicate that determines whether the sender has the permission
      Returns:
      created permission node
    • of

      static <C> PredicatePermission<C> of(@NonNull Predicate<C> predicate)
      Creates a new predicate permission
      Type Parameters:
      C - command sender type
      Parameters:
      predicate - predicate that determines whether the sender has the permission
      Returns:
      created permission node
    • key

      default @NonNull CloudKey<Void> key()
      Description copied from interface: CloudKeyHolder
      Returns the key that identifies this object.
      Specified by:
      key in interface CloudKeyHolder<C>
      Returns:
      the identifying key.
    • permissionString

      default @NonNull String permissionString()
      Description copied from interface: Permission
      Returns the string representation of the permission.
      Specified by:
      permissionString in interface Permission
      Returns:
      string representation
    • testPermission

      Checks whether the given sender has this permission
      Parameters:
      sender - sender to check for
      Returns:
      a PermissionResult representing the check result
    • isEmpty

      default boolean isEmpty()
      Description copied from interface: Permission
      Returns true if a check for this permission should and will always return true.
      Specified by:
      isEmpty in interface Permission
      Returns:
      true if this permission is empty, otherwise false