public class PermissionAttachment
extends java.lang.Object
Permissible
object| 构造器和说明 |
|---|
PermissionAttachment(Plugin plugin,
Permissible Permissible) |
| 限定符和类型 | 方法和说明 |
|---|---|
Permissible |
getPermissible()
Gets the Permissible that this is attached to
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getPermissions()
Gets a copy of all set permissions and values contained within this
attachment.
|
Plugin |
getPlugin()
Gets the plugin responsible for this attachment
|
PermissionRemovedExecutor |
getRemovalCallback()
Gets the class that was previously set to be called when this
attachment was removed from a
Permissible. |
boolean |
remove()
Removes this attachment from its registered
Permissible |
void |
setPermission(Permission perm,
boolean value)
Sets a permission to the given value
|
void |
setPermission(java.lang.String name,
boolean value)
Sets a permission to the given value, by its fully qualified name
|
void |
setRemovalCallback(PermissionRemovedExecutor ex)
Sets an object to be called for when this attachment is removed from a
Permissible. |
void |
unsetPermission(Permission perm)
Removes the specified permission from this attachment.
|
void |
unsetPermission(java.lang.String name)
Removes the specified permission from this attachment.
|
public PermissionAttachment(Plugin plugin, Permissible Permissible)
public Plugin getPlugin()
public void setRemovalCallback(PermissionRemovedExecutor ex)
Permissible. May be null.ex - Object to be called when this is removedpublic PermissionRemovedExecutor getRemovalCallback()
Permissible. May be null.public Permissible getPermissible()
public java.util.Map<java.lang.String,java.lang.Boolean> getPermissions()
This map may be modified but will not affect the attachment, as it is a copy.
public void setPermission(java.lang.String name,
boolean value)
name - Name of the permissionvalue - New value of the permissionpublic void setPermission(Permission perm, boolean value)
perm - Permission to setvalue - New value of the permissionpublic void unsetPermission(java.lang.String name)
If the permission does not exist in this attachment, nothing will happen.
name - Name of the permission to removepublic void unsetPermission(Permission perm)
If the permission does not exist in this attachment, nothing will happen.
perm - Permission to removepublic boolean remove()
Permissible