Package net.luckperms.api.cacheddata
Interface CachedPermissionData
- All Superinterfaces:
CachedData
Holds cached permission lookup data for a specific set of contexts.
All calls will account for inheritance, as well as any default data provided by the platform. These calls are heavily cached and are therefore fast.
-
Method Summary
Modifier and TypeMethodDescriptioncheckPermission(@NonNull String permission) Performs a permission check for the givenpermissionnode.Gets an immutable copy of the permission map backing the permission calculatorvoidInvalidates the underlying permission calculator cache.queryPermission(@NonNull String permission) Performs a permission check for the givenpermissionnode.Methods inherited from interface net.luckperms.api.cacheddata.CachedData
getQueryOptions
-
Method Details
-
queryPermission
Performs a permission check for the givenpermissionnode.This check is equivalent to the "hasPermission" method call on most platforms. You can use
Tristate.asBoolean()if you need a truthy result.- Parameters:
permission- the permission node- Returns:
- a result containing the tristate
- Throws:
NullPointerException- if permission is null- Since:
- 5.4
-
checkPermission
Performs a permission check for the givenpermissionnode.This check is equivalent to the "hasPermission" method call on most platforms. You can use
Tristate.asBoolean()if you need a truthy result.- Parameters:
permission- the permission node- Returns:
- a tristate result
- Throws:
NullPointerException- if permission is null
-
invalidateCache
void invalidateCache()Invalidates the underlying permission calculator cache.Can be called to allow for an update in defaults.
-
getPermissionMap
@NonNull @Unmodifiable Map<String,Boolean> getPermissionMap()Gets an immutable copy of the permission map backing the permission calculator- Returns:
- an immutable set of permissions
-