Class Permission

java.lang.Object
net.minestom.server.permission.Permission

public class Permission extends Object
Representation of a permission granted to a CommandSender. Each permission has a string representation used as an identifier, and an optional NBTCompound used to store additional data.

The class is immutable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Permission(@NotNull String permissionName)
    Creates a new permission object without additional data
    Permission(@NotNull String permissionName, @Nullable org.jglrxavpok.hephaistos.nbt.NBTCompound data)
    Creates a new permission object with optional data.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    @Nullable org.jglrxavpok.hephaistos.nbt.NBTCompound
    Gets the data associated to this permission.
    @NotNull String
    Gets the name of the permission.
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Permission

      public Permission(@NotNull @NotNull String permissionName, @Nullable @Nullable org.jglrxavpok.hephaistos.nbt.NBTCompound data)
      Creates a new permission object with optional data.
      Parameters:
      permissionName - the name of the permission
      data - the optional data of the permission
    • Permission

      public Permission(@NotNull @NotNull String permissionName)
      Creates a new permission object without additional data
      Parameters:
      permissionName - the name of the permission
  • Method Details

    • getPermissionName

      @NotNull public @NotNull String getPermissionName()
      Gets the name of the permission.
      Returns:
      the permission name
    • getNBTData

      @Nullable public @Nullable org.jglrxavpok.hephaistos.nbt.NBTCompound getNBTData()
      Gets the data associated to this permission.
      Returns:
      the nbt data of this permission, can be null if not any
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object