类 Permission
Permissible
-
字段概要
-
构造器概要
构造器说明Permission
(String name) Permission
(String name, String description) Permission
(String name, String description, PermissionDefault defaultValue) Permission
(String name, String description, PermissionDefault defaultValue, Map<String, Boolean> children) Permission
(String name, Map<String, Boolean> children) Permission
(String name, PermissionDefault defaultValue) Permission
(String name, PermissionDefault defaultValue, Map<String, Boolean> children) -
方法概要
修饰符和类型方法说明Adds this permission to the specified parent permission.void
addParent
(Permission perm, boolean value) Adds this permission to the specified parent permission.Gets the children of this permission.Gets the default value of this permission.Gets a brief description of this permission, if setgetName()
Returns the unique fully qualified name of this PermissionGets a set containing everyPermissible
that has this permission.static Permission
loadPermission
(String name, Map<?, ?> data, PermissionDefault def, List<Permission> output) Loads a Permission from a map of data, usually used from retrieval from a yaml file.static Permission
loadPermission
(String name, Map<String, Object> data) Loads a Permission from a map of data, usually used from retrieval from a yaml file.static List<Permission>
loadPermissions
(Map<?, ?> data, String error, PermissionDefault def) Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.void
Recalculates allPermissible
s that contain this permission.void
setDefault
(PermissionDefault value) Sets the default value of this permission.void
setDescription
(String value) Sets the description of this permission.
-
字段详细资料
-
DEFAULT_PERMISSION
-
-
构造器详细资料
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
-
方法详细资料
-
getName
Returns the unique fully qualified name of this Permission- 返回:
- Fully qualified name
-
getChildren
Gets the children of this permission.If you change this map in any form, you must call
recalculatePermissibles()
to recalculate allPermissible
s- 返回:
- Permission children
-
getDefault
Gets the default value of this permission.- 返回:
- Default value of this permission.
-
setDefault
Sets the default value of this permission.This will not be saved to disk, and is a temporary operation until the server reloads permissions. Changing this default will cause all
Permissible
s that contain this permission to recalculate their permissions- 参数:
value
- The new default to set
-
getDescription
Gets a brief description of this permission, if set- 返回:
- Brief description of this permission
-
setDescription
Sets the description of this permission.This will not be saved to disk, and is a temporary operation until the server reloads permissions.
- 参数:
value
- The new description to set
-
getPermissibles
Gets a set containing everyPermissible
that has this permission.This set cannot be modified.
- 返回:
- Set containing permissibles with this permission
-
recalculatePermissibles
public void recalculatePermissibles()Recalculates allPermissible
s that contain this permission.This should be called after modifying the children, and is automatically called after modifying the default value
-
addParent
Adds this permission to the specified parent permission.If the parent permission does not exist, it will be created and registered.
- 参数:
name
- Name of the parent permissionvalue
- The value to set this permission to- 返回:
- Parent permission it created or loaded
-
addParent
Adds this permission to the specified parent permission.- 参数:
perm
- Parent permission to register withvalue
- The value to set this permission to
-
loadPermissions
Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.The data may contain a list of name:data, where the data contains the following keys:
- default: Boolean true or false. If not specified, false.
- children:
Map<String, Boolean>
of child permissions. If not specified, empty list. - description: Short string containing a very small description of this description. If not specified, empty string.
- 参数:
data
- Map of permissionserror
- An error message to show if a permission is invalid.def
- Default permission value to use if missing- 返回:
- Permission object
-
loadPermission
Loads a Permission from a map of data, usually used from retrieval from a yaml file.The data may contain the following keys:
- default: Boolean true or false. If not specified, false.
- children:
Map<String, Boolean>
of child permissions. If not specified, empty list. - description: Short string containing a very small description of this description. If not specified, empty string.
- 参数:
name
- Name of the permissiondata
- Map of keys- 返回:
- Permission object
-
loadPermission
public static Permission loadPermission(String name, Map<?, ?> data, PermissionDefault def, List<Permission> output) Loads a Permission from a map of data, usually used from retrieval from a yaml file.The data may contain the following keys:
- default: Boolean true or false. If not specified, false.
- children:
Map<String, Boolean>
of child permissions. If not specified, empty list. - description: Short string containing a very small description of this description. If not specified, empty string.
- 参数:
name
- Name of the permissiondata
- Map of keysdef
- Default permission value to use if not setoutput
- A list to append any created child-Permissions to, may be null- 返回:
- Permission object
-