public class PermissionAttachment extends Object
Permissible
objectConstructor and Description |
---|
PermissionAttachment(@NotNull Plugin plugin,
@NotNull Permissible permissible) |
Modifier and Type | Method and Description |
---|---|
@NotNull Permissible |
getPermissible()
Gets the Permissible that this is attached to
|
@NotNull Map<String,Boolean> |
getPermissions()
Gets a copy of all set permissions and values contained within this
attachment.
|
@NotNull Plugin |
getPlugin()
Gets the plugin responsible for this attachment
|
@Nullable 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(@NotNull Permission perm,
boolean value)
Sets a permission to the given value
|
void |
setPermission(@NotNull String name,
boolean value)
Sets a permission to the given value, by its fully qualified name
|
void |
setRemovalCallback(@Nullable PermissionRemovedExecutor ex)
Sets an object to be called for when this attachment is removed from a
Permissible . |
void |
unsetPermission(@NotNull Permission perm)
Removes the specified permission from this attachment.
|
void |
unsetPermission(@NotNull String name)
Removes the specified permission from this attachment.
|
@NotNull public @NotNull Plugin getPlugin()
public void setRemovalCallback(@Nullable @Nullable PermissionRemovedExecutor ex)
Permissible
. May be null.ex
- Object to be called when this is removed@Nullable public @Nullable PermissionRemovedExecutor getRemovalCallback()
Permissible
. May be null.@NotNull public @NotNull Permissible getPermissible()
@NotNull public @NotNull Map<String,Boolean> getPermissions()
This map may be modified but will not affect the attachment, as it is a copy.
public void setPermission(@NotNull @NotNull String name, boolean value)
name
- Name of the permissionvalue
- New value of the permissionpublic void setPermission(@NotNull @NotNull Permission perm, boolean value)
perm
- Permission to setvalue
- New value of the permissionpublic void unsetPermission(@NotNull @NotNull String name)
If the permission does not exist in this attachment, nothing will happen.
name
- Name of the permission to removepublic void unsetPermission(@NotNull @NotNull 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.