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 Summary
Modifier and TypeMethodDescriptiongetKey()Get the key that identifies this object.default @NonNull Collection<@NonNull CommandPermission>Get the permission nodesbooleanhasPermission(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:CloudKeyHolderGet the key that identifies this object.- Specified by:
getKeyin interfaceCloudKeyHolder<C>- Returns:
- Identifying key.
-
hasPermission
Check whether or not the given sender has this permission- Parameters:
sender- Sender to check for- Returns:
trueif the sender has the given permission, elsefalse
-
getPermissions
Description copied from interface:CommandPermissionGet the permission nodes- Specified by:
getPermissionsin interfaceCommandPermission- Returns:
- Permission nodes
-