Package cn.lunadeer.dominion.api.dtos
Interface GroupDTO
public interface GroupDTO
Public view of a permission group belonging to a dominion.
A group's name may contain Dominion color syntax. Its privilege values are evaluated for members assigned to the group.
-
Method Summary
Modifier and TypeMethodDescription@NotNull IntegergetDomID()Gets the ID of the dominion to which the group belongs.Gets all flag values for the group.@NotNull BooleangetFlagValue(@NotNull PriFlag flag) Gets the value of a specific flag for the group.@NotNull IntegergetId()Gets the ID of the group.Gets all members of the group.@NotNull StringGets the formatted group title as a Bukkit legacy color-code string.@NotNull net.kyori.adventure.text.ComponentGets the formatted group title as an AdventureComponent.@NotNull StringGets the name of the group in plain text (without color codes).@NotNull StringGets the raw name of the group, including Dominion color codes.@NotNull GroupDTOsetFlagValue(@NotNull PriFlag flag, @NotNull Boolean value) Sets the value of a specific privilege flag for the group.@NotNull GroupDTOSets the name of the group.
-
Method Details
-
getId
Gets the ID of the group.- Returns:
- the ID of the group
-
getDomID
Gets the ID of the dominion to which the group belongs.- Returns:
- the ID of the dominion
-
setName
Sets the name of the group. The name may include Dominion color codes.- Parameters:
name- the name of the group- Returns:
- this group after the name has been updated
- Throws:
SQLException- if a database access error occurs
-
getNamePlain
Gets the name of the group in plain text (without color codes). This method should be used in most cases to get the group name.- Returns:
- the plain text name of the group
-
getNameRaw
Gets the raw name of the group, including Dominion color codes.- Returns:
- the raw name of the group
-
getNameColoredComponent
@NotNull @NotNull net.kyori.adventure.text.Component getNameColoredComponent()Gets the formatted group title as an AdventureComponent.- Returns:
- the formatted group title
-
getNameColoredBukkit
Gets the formatted group title as a Bukkit legacy color-code string.- Returns:
- the formatted group title
-
getFlagValue
Gets the value of a specific flag for the group.- Parameters:
flag- the flag- Returns:
- the value of the flag, or the default value if the flag does not exist
-
getFlagsValue
Gets all flag values for the group.- Returns:
- a map of flag values
-
setFlagValue
@NotNull @NotNull GroupDTO setFlagValue(@NotNull @NotNull PriFlag flag, @NotNull @NotNull Boolean value) throws SQLException Sets the value of a specific privilege flag for the group.- Parameters:
flag- the flagvalue- the value of the flag- Returns:
- this group after the flag has been updated
- Throws:
SQLException- if a database access error occurs
-
getMembers
Gets all members of the group.- Returns:
- a list of members
- Throws:
SQLException- if a database access error occurs
-