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
public interface PredicatePermission<C>
extends CommandPermission, CloudKeyHolder<Void>
A functional
CommandPermission
implementation- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Get the key that identifies this object.default @NonNull Collection<@NonNull CommandPermission>
Get the permission nodesboolean
hasPermission(C sender)
Check whether or not the given sender has this permissionstatic <C> PredicatePermission<C>
Create a new predicate permission
-
Method Details
-
of
Create a new predicate permission- Type Parameters:
C
- Command sender type- Parameters:
key
- Key that identifies the permission nodepredicate
- Predicate that determines whether or not the sender has the permission- Returns:
- Created permission node
-
getKey
Description copied from interface:CloudKeyHolder
Get the key that identifies this object.- Specified by:
getKey
in interfaceCloudKeyHolder<C>
- Returns:
- Identifying key.
-
hasPermission
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, elsefalse
-
getPermissions
Description copied from interface:CommandPermission
Get the permission nodes- Specified by:
getPermissions
in interfaceCommandPermission
- Returns:
- Permission nodes
-