Interface PredicatePermission<C>

  • Type Parameters:
    C - Command sender type
    All Superinterfaces:
    CloudKeyHolder<java.lang.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
    public interface PredicatePermission<C>
    extends CommandPermission, CloudKeyHolder<java.lang.Void>
    A functional CommandPermission implementation
    Since:
    1.4.0
    • Method Detail

      • of

        static <C> PredicatePermission<C> of​(@NonNull CloudKey<java.lang.Void> key,
                                             @NonNull java.util.function.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<java.lang.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