Class PluginPermission

java.lang.Object
eu.hexagonmc.spigot.annotation.meta.PluginPermission

public class PluginPermission extends Object
  • Constructor Details

    • PluginPermission

      public PluginPermission(String name)
      Creates a new permission from a name.
      Parameters:
      name - The name of the permission
  • Method Details

    • from

      public static PluginPermission from(Permission annotation)
      Creates permission from an annotation. Parses the data stored in the annotation.
      Parameters:
      annotation - The annotation to parse for data
      Returns:
      The new permission
      See Also:
    • setName

      public void setName(String name)
      Sets the name of this permission.
      Parameters:
      name - The name to set
    • getName

      public String getName()
      The name of this permission.
      Returns:
      The name
    • setDescription

      public void setDescription(String description)
      Sets the description of this permission.
      Parameters:
      description - The description to set
    • getDescription

      public String getDescription()
      The description of this permission.
      Returns:
      The description
    • setDefault

      public void setDefault(PermissionDefault def)
      Sets the default behavior of this permission.
      Parameters:
      def - The default behavior to set
      See Also:
    • getDefault

      public PermissionDefault getDefault()
      The default behavior of this permission.
      Returns:
      The default behavior
      See Also:
    • addChild

      public void addChild(String node, boolean state)
      Adds a child permission to this permission.
      Parameters:
      node - The node of the child
      state - The state of the child.
    • getChilds

      public Map<String,Boolean> getChilds()
      Gets all child permissions.
      Returns:
      The child permissions
    • removeChild

      public boolean removeChild(String node)
      Removes child permission from this permission.
      Parameters:
      node - The node of the child to remove
      Returns:
      true if the command was removed false if it did not exist
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object