Class RoleImpl

    • Constructor Detail

      • RoleImpl

        public RoleImpl​(DiscordApiImpl api,
                        ServerImpl server,
                        com.fasterxml.jackson.databind.JsonNode data)
        Creates a new role object.
        Parameters:
        api - The discord api instance.
        server - The server of the role.
        data - The json data of the role.
    • Method Detail

      • addUserToCache

        public void addUserToCache​(User user)
        Adds a user to the role.
        Parameters:
        user - The user to add.
      • removeUserFromCache

        public void removeUserFromCache​(User user)
        Removes a user from the role.
        Parameters:
        user - The user to remove.
      • getColorAsInt

        public int getColorAsInt​()
        Gets the color of the role as int.
        Returns:
        The color of the role as int.
      • setColor

        public void setColor​(int color)
        Sets the color of the role.
        Parameters:
        color - The color to set.
      • setHoist

        public void setHoist​(boolean hoist)
        Sets the hoist flag of the role.
        Parameters:
        hoist - The hoist flag to set.
      • setMentionable

        public void setMentionable​(boolean mentionable)
        Sets the mentionable flag of the role.
        Parameters:
        mentionable - The mentionable flag to set.
      • setName

        public void setName​(String name)
        Sets the name of the role.
        Parameters:
        name - The name to set.
      • setPermissions

        public void setPermissions​(PermissionsImpl permissions)
        Sets the permissions of the role.
        Parameters:
        permissions - The permissions to set.
      • setPosition

        public void setPosition​(int position)
        Sets the position of the role.
        Parameters:
        position - The position to set.
      • getPosition

        public int getPosition​()
        Specified by:
        getPosition in interface Role
      • isMentionable

        public boolean isMentionable​()
        Specified by:
        isMentionable in interface Role
      • isManaged

        public boolean isManaged​()
        Specified by:
        isManaged in interface Role
      • hashCode

        public int hashCode​()
        Overrides:
        hashCode in class Object