org.bukkit.permissions
Class PermissionAttachment

java.lang.Object
  extended by org.bukkit.permissions.PermissionAttachment

public class PermissionAttachment
extends Object

Holds information about a permission attachment on a Permissible object


Constructor Summary
PermissionAttachment(Plugin plugin, Permissible Permissible)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionAttachment

public PermissionAttachment(Plugin plugin,
                            Permissible Permissible)
Method Detail

getPlugin

public Plugin getPlugin()
Gets the plugin responsible for this attachment

Returns:
Plugin responsible for this permission attachment

setRemovalCallback

public void setRemovalCallback(PermissionRemovedExecutor ex)
Sets an object to be called for when this attachment is removed from a Permissible. May be null.

Parameters:
ex - Object to be called when this is removed

getRemovalCallback

public PermissionRemovedExecutor getRemovalCallback()
Gets the class that was previously set to be called when this attachment was removed from a Permissible. May be null.

Returns:
Object to be called when this is removed

getPermissible

public Permissible getPermissible()
Gets the Permissible that this is attached to

Returns:
Permissible containing this attachment

getPermissions

public Map<String,Boolean> getPermissions()
Gets a copy of all set permissions and values contained within this attachment.

This map may be modified but will not affect the attachment, as it is a copy.

Returns:
Copy of all permissions and values expressed by this attachment

setPermission

public void setPermission(String name,
                          boolean value)
Sets a permission to the given value, by its fully qualified name

Parameters:
name - Name of the permission
value - New value of the permission

setPermission

public void setPermission(Permission perm,
                          boolean value)
Sets a permission to the given value

Parameters:
perm - Permission to set
value - New value of the permission

unsetPermission

public void unsetPermission(String name)
Removes the specified permission from this attachment.

If the permission does not exist in this attachment, nothing will happen.

Parameters:
name - Name of the permission to remove

unsetPermission

public void unsetPermission(Permission perm)
Removes the specified permission from this attachment.

If the permission does not exist in this attachment, nothing will happen.

Parameters:
perm - Permission to remove

remove

public boolean remove()
Removes this attachment from its registered Permissible

Returns:
true if the permissible was removed successfully, false if it did not exist


Copyright © 2013. All Rights Reserved.