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 functionalCommandPermissionimplementation- Since:
- 1.4.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NonNull CloudKey<java.lang.Void>getKey()Get the key that identifies this object.default @NonNull java.util.Collection<@NonNull CommandPermission>getPermissions()Get the permission nodesbooleanhasPermission(C sender)Check whether or not the given sender has this permissionstatic <C> PredicatePermission<C>of(@NonNull CloudKey<java.lang.Void> key, @NonNull java.util.function.Predicate<C> predicate)Create a new predicate permission
-
-
-
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 nodepredicate- 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:CloudKeyHolderGet the key that identifies this object.- Specified by:
getKeyin interfaceCloudKeyHolder<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:
trueif the sender has the given permission, elsefalse
-
getPermissions
default @NonNull java.util.Collection<@NonNull CommandPermission> getPermissions()
Description copied from interface:CommandPermissionGet the permission nodes- Specified by:
getPermissionsin interfaceCommandPermission- Returns:
- Permission nodes
-
-