|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.permissions.Permission
public class Permission
Represents a unique permission that may be attached to a Permissible
Field Summary | |
---|---|
static PermissionDefault |
DEFAULT_PERMISSION
|
Constructor Summary | |
---|---|
Permission(String name)
|
|
Permission(String name,
Map<String,Boolean> children)
|
|
Permission(String name,
PermissionDefault defaultValue)
|
|
Permission(String name,
PermissionDefault defaultValue,
Map<String,Boolean> children)
|
|
Permission(String name,
String description)
|
|
Permission(String name,
String description,
Map<String,Boolean> children)
|
|
Permission(String name,
String description,
PermissionDefault defaultValue)
|
|
Permission(String name,
String description,
PermissionDefault defaultValue,
Map<String,Boolean> children)
|
Method Summary | |
---|---|
void |
addParent(Permission perm,
boolean value)
Adds this permission to the specified parent permission. |
Permission |
addParent(String name,
boolean value)
Adds this permission to the specified parent permission. |
Map<String,Boolean> |
getChildren()
Gets the children of this permission. |
PermissionDefault |
getDefault()
Gets the default value of this permission. |
String |
getDescription()
Gets a brief description of this permission, if set |
String |
getName()
Returns the unique fully qualified name of this Permission |
Set<Permissible> |
getPermissibles()
Gets a set containing every Permissible 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 |
recalculatePermissibles()
Recalculates all Permissible 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PermissionDefault DEFAULT_PERMISSION
Constructor Detail |
---|
public Permission(String name)
public Permission(String name, String description)
public Permission(String name, PermissionDefault defaultValue)
public Permission(String name, String description, PermissionDefault defaultValue)
public Permission(String name, Map<String,Boolean> children)
public Permission(String name, String description, Map<String,Boolean> children)
public Permission(String name, PermissionDefault defaultValue, Map<String,Boolean> children)
public Permission(String name, String description, PermissionDefault defaultValue, Map<String,Boolean> children)
Method Detail |
---|
public String getName()
public Map<String,Boolean> getChildren()
recalculatePermissibles()
to recalculate all Permissible
s
public PermissionDefault getDefault()
public void setDefault(PermissionDefault value)
Permissible
s that contain this permission to recalculate their permissions
value
- The new default to setpublic String getDescription()
public void setDescription(String value)
value
- The new description to setpublic Set<Permissible> getPermissibles()
Permissible
that has this permission.
This set cannot be modified.
public void recalculatePermissibles()
Permissible
s that contain this permission.
This should be called after modifying the children, and is automatically called after modifying the default value
public Permission addParent(String name, boolean value)
name
- Name of the parent permissionvalue
- The value to set this permission to
public void addParent(Permission perm, boolean value)
perm
- Parent permission to register withvalue
- The value to set this permission topublic static List<Permission> loadPermissions(Map<?,?> data, String error, PermissionDefault def)
data
- Map of permissionserror
- An error message to show if a permission is invalid.def
- Default permission value to use if missing
public static Permission loadPermission(String name, Map<String,Object> data)
name
- Name of the permissiondata
- Map of keys
public static Permission loadPermission(String name, Map<?,?> data, PermissionDefault def, List<Permission> output)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |