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 StringgetColor()Gets the color of the dominion as a string.intGets the blue component of the dominion's color.intGets the green component of the dominion's color.intGets the hexadecimal representation of the dominion's color.intGets the red component of the dominion's color.@NotNull CuboidDTOGets the cuboid of the dominion.booleangetEnvFlagValue(@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.booleangetGuestFlagValue(@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 IntegergetId()Gets the ID of the dominion.@NotNull StringGets the welcome message of the dominion.@NotNull StringGets the leave message of the dominion.Gets all members of the dominion.@NotNull StringgetName()Gets the name of the dominion.@NotNull UUIDgetOwner()Gets the UUID of the dominion owner.@NotNull PlayerDTOGets the DTO of the dominion owner.@NotNull IntegerGets the ID of the parent dominion.Gets the server ID associated with the dominion.@NotNull org.bukkit.LocationGets the teleport location of the dominion.@Nullable org.bukkit.WorldgetWorld()Gets the world where the dominion is located.@NotNull UUIDGets the UUID of the world where the dominion is located.@NotNull DominionDTOsetColor(@NotNull org.bukkit.Color color) Sets the color of the dominion.@NotNull DominionDTOSets the cuboid of the dominion.@NotNull DominionDTOsetEnvFlagValue(@NotNull EnvFlag flag, @NotNull Boolean value) Sets the value of a specific environment or guest privilege flag of the dominion.@NotNull DominionDTOsetGuestFlagValue(@NotNull PriFlag flag, @NotNull Boolean value) Sets the value of a specific environment or guest privilege flag of the dominion.@NotNull DominionDTOsetJoinMessage(String joinMessage) Sets the welcome message of the dominion.@NotNull DominionDTOsetLeaveMessage(String leaveMessage) Sets the leave message of the dominion.@NotNull DominionDTOSets the name of the dominion.@NotNull DominionDTOSets the owner of the dominion.@NotNull DominionDTOsetOwner(org.bukkit.entity.Player owner) Sets the owner of the dominion.@NotNull DominionDTOsetTpLocation(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
-