Interface DominionDTO


public interface DominionDTO
Public view of a Dominion and its persisted settings.

Mutating methods update the Dominion data store and return this dominion instance when the update succeeds. Database failures are reported through SQLException.

  • Method Details

    • getId

      @NotNull @NotNull Integer getId()
      Gets the ID of the dominion.
      Returns:
      the ID of the dominion
    • getOwner

      @NotNull @NotNull UUID getOwner()
      Gets the UUID of the dominion owner.
      Returns:
      the UUID of the dominion owner
    • getOwnerDTO

      @NotNull @NotNull PlayerDTO getOwnerDTO()
      Gets the DTO of the dominion owner.

      Implementations may return PlayerDTO.UNKNOWN when the owner is not present in the player cache.

      Returns:
      the DTO of the dominion owner
    • setOwner

      @NotNull @NotNull DominionDTO setOwner(UUID owner) throws SQLException
      Sets the owner of the dominion.
      Parameters:
      owner - the UUID of the dominion owner
      Returns:
      this dominion after the owner has been updated
      Throws:
      SQLException - if a database access error occurs
    • setOwner

      @NotNull @NotNull DominionDTO setOwner(org.bukkit.entity.Player owner) throws SQLException
      Sets the owner of the dominion using a Bukkit player.
      Parameters:
      owner - the dominion owner
      Returns:
      this dominion after the owner has been updated
      Throws:
      SQLException - if a database access error occurs
    • getName

      @NotNull @NotNull String getName()
      Gets the name of the dominion.
      Returns:
      the name of the dominion
    • setName

      @NotNull @NotNull DominionDTO setName(String name) throws SQLException
      Sets the name of the dominion.
      Parameters:
      name - the name of the dominion
      Returns:
      this dominion after the name has been updated
      Throws:
      SQLException - if a database access error occurs
    • getWorld

      @Nullable @Nullable org.bukkit.World getWorld()
      Gets the world where the dominion is located. Returns null if the world does not exist.
      Returns:
      the world where the dominion is located
    • getWorldUid

      @NotNull @NotNull UUID getWorldUid()
      Gets the UUID of the world where the dominion is located. This method guarantees a non-null UUID, but does not guarantee the existence of the world. To check if the world exists, use getWorld().
      Returns:
      the UUID of the world where the dominion is located
    • getCuboid

      @NotNull @NotNull CuboidDTO getCuboid()
      Gets the cuboid of the dominion.

      The cuboid uses the coordinate conventions documented by CuboidDTO.

      Returns:
      the cuboid of the dominion
    • setCuboid

      @NotNull @NotNull DominionDTO setCuboid(@NotNull @NotNull CuboidDTO cuboid) throws SQLException
      Sets the cuboid of the dominion.
      Parameters:
      cuboid - the cuboid of the dominion
      Returns:
      this dominion after the cuboid has been updated
      Throws:
      SQLException - if a database access error occurs
    • getParentDomId

      @NotNull @NotNull Integer getParentDomId()
      Gets the ID of the parent dominion.
      Returns:
      the ID of the parent dominion, or -1 if there is no parent dominion
    • getJoinMessage

      @NotNull @NotNull String getJoinMessage()
      Gets the message sent when a player enters the dominion.
      Returns:
      the enter message
    • setJoinMessage

      @NotNull @NotNull DominionDTO setJoinMessage(String joinMessage) throws SQLException
      Sets the message sent when a player enters the dominion.
      Parameters:
      joinMessage - the enter message
      Returns:
      this dominion after the message has been updated
      Throws:
      SQLException - if a database access error occurs
    • getLeaveMessage

      @NotNull @NotNull String getLeaveMessage()
      Gets the message sent when a player leaves the dominion.
      Returns:
      the leave message
    • setLeaveMessage

      @NotNull @NotNull DominionDTO setLeaveMessage(String leaveMessage) throws SQLException
      Sets the message sent when a player leaves the dominion.
      Parameters:
      leaveMessage - the leave message
      Returns:
      this dominion after the message has been updated
      Throws:
      SQLException - if a database access error occurs
    • getEnvironmentFlagValue

      @NotNull @NotNull Map<EnvFlag,Boolean> getEnvironmentFlagValue()
      Gets the environment flag values configured for the dominion.
      Returns:
      a map from environment flags to their configured values
    • getEnvFlagValue

      boolean getEnvFlagValue(@NotNull @NotNull EnvFlag flag)
      Gets the value of a specific environment flag of the dominion.
      Parameters:
      flag - the environment flag
      Returns:
      the value of the environment flag
    • getGuestPrivilegeFlagValue

      @NotNull @NotNull Map<PriFlag,Boolean> getGuestPrivilegeFlagValue()
      Gets the privilege flag values applied to guests of the dominion.
      Returns:
      a map from privilege flags to their configured guest values
    • getGuestFlagValue

      boolean getGuestFlagValue(@NotNull @NotNull PriFlag flag)
      Gets the value of a specific guest privilege flag of the dominion.
      Parameters:
      flag - the guest privilege flag
      Returns:
      the value of the guest privilege flag
    • setEnvFlagValue

      @NotNull @NotNull DominionDTO setEnvFlagValue(@NotNull @NotNull EnvFlag flag, @NotNull @NotNull Boolean value) throws SQLException
      Sets the value of an environment flag for the dominion.
      Parameters:
      flag - the flag
      value - the value of the flag
      Returns:
      this dominion after the flag has been updated
      Throws:
      SQLException - if a database access error occurs
    • setGuestFlagValue

      @NotNull @NotNull DominionDTO setGuestFlagValue(@NotNull @NotNull PriFlag flag, @NotNull @NotNull Boolean value) throws SQLException
      Sets the value of a guest privilege flag for the dominion.
      Parameters:
      flag - the flag
      value - the value of the flag
      Returns:
      this dominion after the flag has been updated
      Throws:
      SQLException - if a database access error occurs
    • getTpLocation

      @NotNull @NotNull org.bukkit.Location getTpLocation()
      Gets the teleport location of the dominion.

      If no custom location is configured, the center location of the cuboid is returned.

      Returns:
      the teleport location of the dominion
    • setTpLocation

      @NotNull @NotNull DominionDTO setTpLocation(org.bukkit.Location tpLocation) throws SQLException
      Sets the teleport location of the dominion.
      Parameters:
      tpLocation - the teleport location of the dominion
      Returns:
      this dominion after the teleport location has been updated
      Throws:
      SQLException - if a database access error occurs
    • getColorR

      int getColorR()
      Gets the red component of the dominion's color.
      Returns:
      the red component of the dominion's color
    • getColorG

      int getColorG()
      Gets the green component of the dominion's color.
      Returns:
      the green component of the dominion's color
    • getColorB

      int getColorB()
      Gets the blue component of the dominion's color.
      Returns:
      the blue component of the dominion's color
    • getColor

      @NotNull @NotNull String getColor()
      Gets the color of the dominion as a hexadecimal string.
      Returns:
      a color in #RRGGBB form
    • getColorHex

      int getColorHex()
      Gets the hexadecimal representation of the dominion's color.
      Returns:
      the RGB value in the range 0x000000 to 0xFFFFFF
    • setColor

      @NotNull @NotNull DominionDTO setColor(@NotNull @NotNull org.bukkit.Color color) throws SQLException
      Sets the map color of the dominion.
      Parameters:
      color - the color
      Returns:
      this dominion after the color has been updated
      Throws:
      SQLException - if a database access error occurs
    • getGroups

      List<GroupDTO> getGroups()
      Gets all groups belonging to the dominion.
      Returns:
      the list of groups
    • getMembers

      List<MemberDTO> getMembers()
      Gets all members belonging to the dominion.
      Returns:
      the list of members
    • getServerId

      Integer getServerId()
      Gets the server ID associated with the dominion.
      Returns:
      the server ID associated with the dominion