public class PermissionAttachment extends Object
Permissible
objectConstructor and Description |
---|
PermissionAttachment(Plugin plugin,
Permissible Permissible) |
Modifier and Type | Method and Description |
---|---|
Permissible |
getPermissible()
Gets the Permissible that this is attached to
|
Map<String,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(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(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 Map<String,Boolean> getPermissions()
This map may be modified but will not affect the attachment, as it is a copy.
public void setPermission(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(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
Copyright © 2021. All rights reserved.