Interface PredicatePermission<C>

Type Parameters:
C - Command sender type
All Superinterfaces:
CloudKeyHolder<Void>, CommandPermission
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, since="1.4.0") public interface PredicatePermission<C> extends CommandPermission, CloudKeyHolder<Void>
A functional CommandPermission implementation
Since:
1.4.0
  • Method Details

    • of

      static <C> PredicatePermission<C> of(@NonNull CloudKey<Void> key, @NonNull Predicate<C> predicate)
      Create a new predicate permission
      Type Parameters:
      C - Command sender type
      Parameters:
      key - Key that identifies the permission node
      predicate - Predicate that determines whether or not the sender has the permission
      Returns:
      Created permission node
    • getKey

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

      boolean hasPermission(C sender)
      Check whether or not the given sender has this permission
      Parameters:
      sender - Sender to check for
      Returns:
      true if the sender has the given permission, else false
    • getPermissions

      default @NonNull Collection<@NonNull CommandPermission> getPermissions()
      Description copied from interface: CommandPermission
      Get the permission nodes
      Specified by:
      getPermissions in interface CommandPermission
      Returns:
      Permission nodes