Class GroupColorProvider

java.lang.Object
de.murmelmeister.murmelapi.group.color.GroupColorProvider
All Implemented Interfaces:
GroupColor

public final class GroupColorProvider extends Object implements GroupColor
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createGroup(int executorId, int groupId)
    Creates a new group entry in the database with the provided user and group IDs.
    void
    createGroup(int executorId, int groupId, String chatPrefix, String chatSuffix, String chatColor, String tabPrefix, String tabSuffix, String tabColor, String teamPrefix, String teamSuffix, String teamColor)
    Creates a new group with detailed customization options for chat, tab, and team settings.
    void
    deleteGroup(int groupId)
    Deletes the group with the specified group ID from the database.
    boolean
    existsGroup(int groupId)
    Checks if a group with the specified group ID exists in the database.
    getColor(int groupId, GroupColorType type)
    Retrieves the color associated with the specified group and group color type.
    getCreatedAt(int groupId)
    Retrieves the creation timestamp of the group with the specified group ID.
    int
    getCreatedBy(int groupId)
    Retrieves the ID of the user who created the specified group.
    getModifiedAt(int groupId)
    Retrieves the timestamp at which the specified group was last modified.
    int
    getModifiedBy(int groupId)
    Retrieves the ID of the user who last modified the group with the specified group ID.
    getPrefix(int groupId, GroupColorType type)
    Retrieves the prefix associated with the specified group and group color type.
    getSuffix(int groupId, GroupColorType type)
    Retrieves the suffix associated with the specified group and group color type.
    void
    setColor(int executorId, int groupId, GroupColorType type, String color)
    Sets the color associated with the specified group and group color type.
    void
    setPrefix(int executorId, int groupId, GroupColorType type, String prefix)
    Sets the prefix associated with the specified group and group color type.
    void
    setSuffix(int executorId, int groupId, GroupColorType type, String suffix)
    Sets the suffix associated with the specified group and group color type.
    static void
    setup(Database database)
     

    Methods inherited from class java.lang.Object

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

    • GroupColorProvider

      public GroupColorProvider(Database database)
  • Method Details

    • setup

      public static void setup(Database database)
    • existsGroup

      public boolean existsGroup(int groupId)
      Description copied from interface: GroupColor
      Checks if a group with the specified group ID exists in the database.
      Specified by:
      existsGroup in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group to be checked
      Returns:
      True if the group exists, false otherwise
    • createGroup

      public void createGroup(int executorId, int groupId)
      Description copied from interface: GroupColor
      Creates a new group entry in the database with the provided user and group IDs. If the group already exists, the method returns without taking any action.
      Specified by:
      createGroup in interface GroupColor
      Parameters:
      executorId - The unique identifier of the user initiating the group creation
      groupId - The unique identifier of the group to be created
    • createGroup

      public void createGroup(int executorId, int groupId, String chatPrefix, String chatSuffix, String chatColor, String tabPrefix, String tabSuffix, String tabColor, String teamPrefix, String teamSuffix, String teamColor)
      Description copied from interface: GroupColor
      Creates a new group with detailed customization options for chat, tab, and team settings. If the group with the specified groupId already exists, no action is taken.
      Specified by:
      createGroup in interface GroupColor
      Parameters:
      executorId - The unique identifier of the user initiating the group creation.
      groupId - The unique identifier of the group to be created.
      chatPrefix - The prefix to be used for chat messages.
      chatSuffix - The suffix to be used for chat messages.
      chatColor - The color code to be applied to chat messages.
      tabPrefix - The prefix to be displayed in the tab list.
      tabSuffix - The suffix to be displayed in the tab list.
      tabColor - The color code to be applied to the tab list.
      teamPrefix - The prefix to be used for team names.
      teamSuffix - The suffix to be used for team names.
      teamColor - The color code to be applied to team names.
    • deleteGroup

      public void deleteGroup(int groupId)
      Description copied from interface: GroupColor
      Deletes the group with the specified group ID from the database. This operation is performed by the user with the given user ID.
      Specified by:
      deleteGroup in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group to be deleted.
    • getPrefix

      public String getPrefix(int groupId, GroupColorType type)
      Description copied from interface: GroupColor
      Retrieves the prefix associated with the specified group and group color type.
      Specified by:
      getPrefix in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      Returns:
      The prefix string associated with the specified group and type.
    • getSuffix

      public String getSuffix(int groupId, GroupColorType type)
      Description copied from interface: GroupColor
      Retrieves the suffix associated with the specified group and group color type.
      Specified by:
      getSuffix in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      Returns:
      The suffix string associated with the specified group and type.
    • getColor

      public String getColor(int groupId, GroupColorType type)
      Description copied from interface: GroupColor
      Retrieves the color associated with the specified group and group color type.
      Specified by:
      getColor in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      Returns:
      The color string associated with the specified group and type.
    • setPrefix

      public void setPrefix(int executorId, int groupId, GroupColorType type, String prefix)
      Description copied from interface: GroupColor
      Sets the prefix associated with the specified group and group color type.
      Specified by:
      setPrefix in interface GroupColor
      Parameters:
      executorId - The unique identifier of the user initiating the operation.
      groupId - The unique identifier of the group whose prefix is being set.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      prefix - The prefix string to be set for the specified group and type.
    • setSuffix

      public void setSuffix(int executorId, int groupId, GroupColorType type, String suffix)
      Description copied from interface: GroupColor
      Sets the suffix associated with the specified group and group color type.
      Specified by:
      setSuffix in interface GroupColor
      Parameters:
      executorId - The unique identifier of the user initiating the operation.
      groupId - The unique identifier of the group whose suffix is being set.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      suffix - The suffix string to be set for the specified group and type.
    • setColor

      public void setColor(int executorId, int groupId, GroupColorType type, String color)
      Description copied from interface: GroupColor
      Sets the color associated with the specified group and group color type.
      Specified by:
      setColor in interface GroupColor
      Parameters:
      executorId - The unique identifier of the user initiating the operation.
      groupId - The unique identifier of the group whose color is being set.
      type - The type of group color customization (e.g., Chat, Tab, or Team).
      color - The color string to be set for the specified group and type.
    • getCreatedBy

      public int getCreatedBy(int groupId)
      Description copied from interface: GroupColor
      Retrieves the ID of the user who created the specified group.
      Specified by:
      getCreatedBy in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group whose creator ID is to be retrieved.
      Returns:
      The unique identifier of the user who created the group.
    • getCreatedAt

      public Timestamp getCreatedAt(int groupId)
      Description copied from interface: GroupColor
      Retrieves the creation timestamp of the group with the specified group ID.
      Specified by:
      getCreatedAt in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group whose creation timestamp is to be retrieved.
      Returns:
      The creation timestamp of the specified group, or null if the group does not exist.
    • getModifiedBy

      public int getModifiedBy(int groupId)
      Description copied from interface: GroupColor
      Retrieves the ID of the user who last modified the group with the specified group ID.
      Specified by:
      getModifiedBy in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group whose last modifier is to be retrieved.
      Returns:
      The unique identifier of the user who last modified the group.
    • getModifiedAt

      public Timestamp getModifiedAt(int groupId)
      Description copied from interface: GroupColor
      Retrieves the timestamp at which the specified group was last modified.
      Specified by:
      getModifiedAt in interface GroupColor
      Parameters:
      groupId - The unique identifier of the group whose modification timestamp is to be retrieved.
      Returns:
      A Timestamp object representing the last modification time of the specified group.