程序包 org.bukkit.permissions

# 类 Permission

java.lang.Object
org.bukkit.permissions.Permission

public class Permission extends Object
Represents a unique permission that may be attached to a `Permissible`

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `static final PermissionDefault`
  `DEFAULT_PERMISSION`

- ## 构造器概要

  构造器
  构造器
  说明
  `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 Map<String,Boolean> children)`
  `Permission(@NotNull String name, @Nullable PermissionDefault defaultValue)`
  `Permission(@NotNull String name, @Nullable PermissionDefault defaultValue, @Nullable Map<String,Boolean> children)`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull Permission`
  `addParent(@NotNull String name, boolean value)`
  Adds this permission to the specified parent permission.
  `void`
  `addParent(@NotNull Permission perm, boolean value)`
  Adds this permission to the specified parent permission.
  `@NotNull Map<String,Boolean>`
  `getChildren()`
  Gets the children of this permission.
  `@NotNull PermissionDefault`
  `getDefault()`
  Gets the default value of this permission.
  `@NotNull String`
  `getDescription()`
  Gets a brief description of this permission, may be empty
  `@NotNull String`
  `getName()`
  Returns the unique fully qualified name of this Permission
  `@NotNull Set<Permissible>`
  `getPermissibles()`
  Gets a set containing every `Permissible` that has this permission.
  `static @NotNull Permission`
  `loadPermission(@NotNull String name, @NotNull Map<?,?> data, @Nullable PermissionDefault def, @Nullable List<Permission> output)`
  Loads a Permission from a map of data, usually used from retrieval from a yaml file.
  `static @NotNull Permission`
  `loadPermission(@NotNull String name, @NotNull Map<String,Object> data)`
  Loads a Permission from a map of data, usually used from retrieval from a yaml file.
  `static @NotNull List<Permission>`
  `loadPermissions(@NotNull Map<?,?> data, @NotNull String error, @Nullable PermissionDefault def)`
  Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.
  `void`
  `recalculatePermissibles()`
  Recalculates all `Permissible`s that contain this permission.
  `void`
  `setDefault(@NotNull PermissionDefault value)`
  Sets the default value of this permission.
  `void`
  `setDescription(@Nullable String value)`
  Sets the description of this permission.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 字段详细资料

  - ### DEFAULT_PERMISSION

    public static final PermissionDefault DEFAULT_PERMISSION

- ## 构造器详细资料

  - ### Permission

    public Permission(@NotNull @NotNull String name)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable String description)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable PermissionDefault defaultValue)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable String description, @Nullable @Nullable PermissionDefault defaultValue)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable Map<String,Boolean> children)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable String description, @Nullable @Nullable Map<String,Boolean> children)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable PermissionDefault defaultValue, @Nullable @Nullable Map<String,Boolean> children)

  - ### Permission

    public Permission(@NotNull @NotNull String name, @Nullable @Nullable String description, @Nullable @Nullable PermissionDefault defaultValue, @Nullable @Nullable Map<String,Boolean> children)

- ## 方法详细资料

  - ### getName

    @NotNull public @NotNull String getName()
    Returns the unique fully qualified name of this Permission
    返回:
      Fully qualified name

  - ### getChildren

    @NotNull public @NotNull Map<String,Boolean> getChildren()
    Gets the children of this permission.

    If you change this map in any form, you must call `recalculatePermissibles()` to recalculate all `Permissible`s

    返回:
      Permission children

  - ### getDefault

    @NotNull public @NotNull PermissionDefault getDefault()
    Gets the default value of this permission.
    返回:
      Default value of this permission.

  - ### setDefault

    public void setDefault(@NotNull @NotNull PermissionDefault value)
    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

    @NotNull public @NotNull String getDescription()
    Gets a brief description of this permission, may be empty
    返回:
      Brief description of this permission

  - ### setDescription

    public void setDescription(@Nullable @Nullable String value)
    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

    @NotNull public @NotNull Set<Permissible> getPermissibles()
    Gets a set containing every `Permissible` that has this permission.

    This set cannot be modified.

    返回:
      Set containing permissibles with this permission

  - ### recalculatePermissibles

    public void recalculatePermissibles()
    Recalculates all `Permissible`s that contain this permission.

    This should be called after modifying the children, and is automatically called after modifying the default value

  - ### addParent

    @NotNull public @NotNull Permission addParent(@NotNull @NotNull String name, boolean value)
    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 permission
      `value` - The value to set this permission to
    返回:
      Parent permission it created or loaded

  - ### addParent

    public void addParent(@NotNull @NotNull Permission perm, boolean value)
    Adds this permission to the specified parent permission.
    参数:
      `perm` - Parent permission to register with
      `value` - The value to set this permission to

  - ### loadPermissions

    @NotNull public static @NotNull List<Permission> loadPermissions(@NotNull @NotNull Map<?,?> data, @NotNull @NotNull String error, @Nullable @Nullable PermissionDefault def)
    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 permissions
      `error` - An error message to show if a permission is invalid. May contain "%s" format tag, which will be replaced with the name of invalid permission.
      `def` - Default permission value to use if missing
    返回:
      Permission object

  - ### loadPermission

    @NotNull public static @NotNull Permission loadPermission(@NotNull @NotNull String name, @NotNull @NotNull Map<String,Object> data)
    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 permission
      `data` - Map of keys
    返回:
      Permission object

  - ### loadPermission

    @NotNull public static @NotNull Permission loadPermission(@NotNull @NotNull String name, @NotNull @NotNull Map<?,?> data, @Nullable @Nullable PermissionDefault def, @Nullable @Nullable 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 permission
      `data` - Map of keys
      `def` - Default permission value to use if not set
      `output` - A list to append any created child-Permissions to, may be null
    返回:
      Permission object