Package org.incendo.cloud.permission
Interface PredicatePermission<C>
- Type Parameters:
C- command sender type
- All Superinterfaces:
CloudKeyHolder<Void>,Permission
- 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)
public interface PredicatePermission<C>
extends Permission, CloudKeyHolder<Void>
A functional
Permission implementation-
Field Summary
Fields inherited from interface org.incendo.cloud.permission.Permission
EMPTY -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisEmpty()Returns true if a check for this permission should and will always return true.key()Returns the key that identifies this object.static <C> PredicatePermission<C> Creates a new predicate permissionstatic <C> PredicatePermission<C> Creates a new predicate permissionReturns the string representation of the permission.testPermission(@NonNull C sender) Checks whether the given sender has this permissionMethods inherited from interface org.incendo.cloud.permission.Permission
and, and, or, or, permissions
-
Method Details
-
of
Creates a new predicate permission- Type Parameters:
C- command sender type- Parameters:
key- key that identifies the permission nodepredicate- predicate that determines whether the sender has the permission- Returns:
- created permission node
-
of
Creates a new predicate permission- Type Parameters:
C- command sender type- Parameters:
predicate- predicate that determines whether the sender has the permission- Returns:
- created permission node
-
key
Description copied from interface:CloudKeyHolderReturns the key that identifies this object.- Specified by:
keyin interfaceCloudKeyHolder<C>- Returns:
- the identifying key.
-
permissionString
Description copied from interface:PermissionReturns the string representation of the permission.- Specified by:
permissionStringin interfacePermission- Returns:
- string representation
-
testPermission
Checks whether the given sender has this permission- Parameters:
sender- sender to check for- Returns:
- a
PermissionResultrepresenting the check result
-
isEmpty
default boolean isEmpty()Description copied from interface:PermissionReturns true if a check for this permission should and will always return true.- Specified by:
isEmptyin interfacePermission- Returns:
- true if this permission is empty, otherwise false
-