Package cn.lunadeer.dominion.api.dtos
Interface DominionDTO
public interface DominionDTO
Interface representing a Dominion Data Transfer Object (DTO).
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
getColor()
Gets the color of the dominion as a string.int
Gets the blue component of the dominion's color.int
Gets the green component of the dominion's color.int
Gets the hexadecimal representation of the dominion's color.int
Gets the red component of the dominion's color.@NotNull CuboidDTO
Gets the cuboid of the dominion.boolean
getEnvFlagValue
(@NotNull EnvFlag flag) Gets the value of a specific environment flag of the dominion.Gets all environment flag values of the dominion.Gets all groups of the dominion.boolean
getGuestFlagValue
(@NotNull PriFlag flag) Gets the value of a specific guest privilege flag of the dominion.Gets all guest privilege flag values of the dominion.@NotNull Integer
getId()
Gets the ID of the dominion.@NotNull String
Gets the welcome message of the dominion.@NotNull String
Gets the leave message of the dominion.Gets all members of the dominion.@NotNull String
getName()
Gets the name of the dominion.@NotNull UUID
getOwner()
Gets the UUID of the dominion owner.@NotNull PlayerDTO
Gets the DTO of the dominion owner.@NotNull Integer
Gets the ID of the parent dominion.Gets the server ID associated with the dominion.@NotNull org.bukkit.Location
Gets the teleport location of the dominion.@Nullable org.bukkit.World
getWorld()
Gets the world where the dominion is located.@NotNull UUID
Gets the UUID of the world where the dominion is located.@NotNull DominionDTO
setColor
(@NotNull org.bukkit.Color color) Sets the color of the dominion.@NotNull DominionDTO
Sets the cuboid of the dominion.@NotNull DominionDTO
setEnvFlagValue
(@NotNull EnvFlag flag, @NotNull Boolean value) Sets the value of a specific environment or guest privilege flag of the dominion.@NotNull DominionDTO
setGuestFlagValue
(@NotNull PriFlag flag, @NotNull Boolean value) Sets the value of a specific environment or guest privilege flag of the dominion.@NotNull DominionDTO
setJoinMessage
(String joinMessage) Sets the welcome message of the dominion.@NotNull DominionDTO
setLeaveMessage
(String leaveMessage) Sets the leave message of the dominion.@NotNull DominionDTO
Sets the name of the dominion.@NotNull DominionDTO
Sets the owner of the dominion.@NotNull DominionDTO
setOwner
(org.bukkit.entity.Player owner) Sets the owner of the dominion.@NotNull DominionDTO
setTpLocation
(org.bukkit.Location tpLocation) Sets the teleport location of the dominion.
-
Method Details
-
getId
Gets the ID of the dominion.- Returns:
- the ID of the dominion
-
getOwner
Gets the UUID of the dominion owner.- Returns:
- the UUID of the dominion owner
-
getOwnerDTO
Gets the DTO of the dominion owner.- Returns:
- the DTO of the dominion owner
-
setOwner
Sets the owner of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
owner
- the UUID of the dominion owner- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
setOwner
Sets the owner of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
owner
- the dominion owner- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getName
Gets the name of the dominion.- Returns:
- the name of the dominion
-
setName
Sets the name of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
name
- the name of the dominion- Returns:
- the dominion object
- 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
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, usegetWorld()
.- Returns:
- the UUID of the world where the dominion is located
-
getCuboid
Gets the cuboid of the dominion.- Returns:
- the cuboid of the dominion
-
setCuboid
Sets the cuboid of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
cuboid
- the cuboid of the dominion- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getParentDomId
Gets the ID of the parent dominion.- Returns:
- the ID of the parent dominion, or -1 if there is no parent dominion
-
getJoinMessage
Gets the welcome message of the dominion.- Returns:
- the welcome message of the dominion
-
setJoinMessage
Sets the welcome message of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
joinMessage
- the welcome message of the dominion- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getLeaveMessage
Gets the leave message of the dominion.- Returns:
- the leave message of the dominion
-
setLeaveMessage
Sets the leave message of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
leaveMessage
- the leave message of the dominion- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getEnvironmentFlagValue
Gets all environment flag values of the dominion.- Returns:
- the environment flag values of the dominion
-
getEnvFlagValue
Gets the value of a specific environment flag of the dominion.- Parameters:
flag
- the environment flag- Returns:
- the value of the environment flag
-
getGuestPrivilegeFlagValue
Gets all guest privilege flag values of the dominion.- Returns:
- the guest privilege flag values of the dominion
-
getGuestFlagValue
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 a specific environment or guest privilege flag of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
flag
- the flagvalue
- the value of the flag- Returns:
- the dominion object
- 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 specific environment or guest privilege flag of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
flag
- the flagvalue
- the value of the flag- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getTpLocation
@NotNull @NotNull org.bukkit.Location getTpLocation()Gets the teleport location of the dominion. If no teleport location is set, returns the center location of the dominion.- Returns:
- the teleport location of the dominion
-
setTpLocation
Sets the teleport location of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
tpLocation
- the teleport location of the dominion- Returns:
- the dominion object
- 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
Gets the color of the dominion as a string.- Returns:
- the color of the dominion as a string
-
getColorHex
int getColorHex()Gets the hexadecimal representation of the dominion's color.- Returns:
- the hexadecimal representation of the dominion's color
-
setColor
@NotNull @NotNull DominionDTO setColor(@NotNull @NotNull org.bukkit.Color color) throws SQLException Sets the color of the dominion. Returns the dominion object if successful, otherwise returns null.- Parameters:
color
- the color- Returns:
- the dominion object
- Throws:
SQLException
- if a database access error occurs
-
getGroups
Gets all groups of the dominion.- Returns:
- the list of groups
-
getMembers
Gets all members of 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
-