类 Permission
Permissible的唯一权限-
字段概要
字段 -
构造器概要
构造器构造器说明Permission(@NotNull String name) Permission(@NotNull String name, @Nullable String description) Permission(@NotNull String name, @Nullable String description, @Nullable Map<String, Boolean> children) Permission(@NotNull String name, @Nullable String description, @Nullable PermissionDefault defaultValue) Permission(@NotNull String name, @Nullable String description, @Nullable PermissionDefault defaultValue, @Nullable Map<String, Boolean> children) Permission(@NotNull String name, @Nullable PermissionDefault defaultValue) Permission(@NotNull String name, @Nullable PermissionDefault defaultValue, @Nullable Map<String, Boolean> children) -
方法概要
修饰符和类型方法说明将此权限添加到指定的父权限.voidaddParent(@NotNull Permission perm, boolean value) 将此权限添加到指定的父权限.获取此权限的子权限.获取此权限的默认值.获取此权限的简要描述, 可能为空.getName()返回此权限的唯一完全限定名称.获取包含此权限的每个Permissible的集合.static @NotNull PermissionloadPermission(@NotNull String name, @NotNull Map<?, ?> data, @Nullable PermissionDefault def, @Nullable List<Permission> output) 从数据映射加载一个权限, 通常用于从 yaml 文件中检索.static @NotNull Permission从数据映射加载一个权限, 通常用于从 yaml 文件中检索.static @NotNull List<Permission>loadPermissions(@NotNull Map<?, ?> data, @NotNull String error, @Nullable PermissionDefault def) 从数据映射加载权限列表, 通常用于从yaml文件中检索.void重新计算所有包含此权限的Permissible.voidsetDefault(@NotNull PermissionDefault value) 设置此权限的默认值.voidsetDescription(@Nullable String value) 设置此权限的描述.
-
字段详细资料
-
DEFAULT_PERMISSION
-
-
构造器详细资料
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
Permission
-
-
方法详细资料
-
getName
返回此权限的唯一完全限定名称.原文: Returns the unique fully qualified name of this Permission
- 返回:
- 完全限定名称
-
getChildren
获取此权限的子权限.如果你以任何形式更改此映射, 必须调用
recalculatePermissibles()来重新计算所有Permissible原文: Gets the children of this permission.
If you change this map in any form, you must call
recalculatePermissibles()to recalculate allPermissibles- 返回:
- 权限子项
-
getDefault
获取此权限的默认值.原文: Gets the default value of this permission.
- 返回:
- 此权限的默认值.
-
setDefault
设置此权限的默认值.这不会保存到磁盘, 是服务器重新加载权限之前的临时操作. 更改此默认值将导致所有包含此权限的
Permissible重新计算其权限.原文: 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
Permissibles that contain this permission to recalculate their permissions- 参数:
value- 要设置的新默认值
-
getDescription
获取此权限的简要描述, 可能为空.原文: Gets a brief description of this permission, may be empty
- 返回:
- 此权限的简要描述
-
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- 要设置的新描述
-
getPermissibles
获取包含此权限的每个Permissible的集合.此集合不能被修改.
原文: Gets a set containing every
Permissiblethat has this permission.This set cannot be modified.
- 返回:
- 包含拥有此权限的可权限对象的集合
-
recalculatePermissibles
public void recalculatePermissibles()重新计算所有包含此权限的Permissible.在修改子项后应调用此方法, 在修改默认值后会自动调用.
原文: Recalculates all
Permissibles 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- 父权限名称value- 设置此权限的值- 返回:
- 创建或加载的父权限
-
addParent
将此权限添加到指定的父权限.原文: Adds this permission to the specified parent permission.
- 参数:
perm- 要注册的父权限value- 设置此权限的值
-
loadPermissions
@NotNull public static @NotNull List<Permission> loadPermissions(@NotNull @NotNull Map<?, ?> data, @NotNull @NotNull String error, @Nullable @Nullable PermissionDefault def) 从数据映射加载权限列表, 通常用于从yaml文件中检索.数据可能包含name:data列表, 其中data包含以下键:
- default: Boolean true或false. 如果未指定则为false.
- children: 子权限的
Map<String, Boolean>. 如果未指定则为空列表. - description: 包含此描述的简短字符串. 如果未指定则为空字符串.
原文: 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- 权限映射error- 如果权限无效时显示的错误消息. 可能包含"%s"格式标签, 将被替换为无效权限的名称.def- 如果缺失则使用的默认权限值- 返回:
- Permission对象
-
loadPermission
@NotNull public static @NotNull Permission loadPermission(@NotNull @NotNull String name, @NotNull @NotNull Map<String, Object> data) 从数据映射加载一个权限, 通常用于从 yaml 文件中检索.数据可能包含以下键:
- default: Boolean true 或 false. 如果未指定则为 false.
- children: 子权限的
Map<String, Boolean>. 如果未指定则为空列表. - description: 包含此权限简要描述的短字符串. 如果未指定则为空字符串.
原文: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- 权限名称data- 键映射- 返回:
- Permission 对象
-
loadPermission
@NotNull public static @NotNull Permission loadPermission(@NotNull @NotNull String name, @NotNull @NotNull Map<?, ?> data, @Nullable @Nullable PermissionDefault def, @Nullable @Nullable List<Permission> output) 从数据映射加载一个权限, 通常用于从 yaml 文件中检索.数据可能包含以下键:
- default: Boolean true 或 false. 如果未指定则为 false.
- children: 子权限的
Map<String, Boolean>. 如果未指定则为空列表. - description: 包含此权限简要描述的短字符串. 如果未指定则为空字符串.
原文: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- 权限名称data- 键映射def- 如果未设置则使用的默认权限值output- 用于追加创建的子权限的列表, 可以为 null- 返回:
- Permission 对象
-