Class MemberImpl

    • Constructor Detail

      • MemberImpl

        public MemberImpl​(DiscordApiImpl api,
                          ServerImpl server,
                          com.fasterxml.jackson.databind.JsonNode data,
                          UserImpl user)
        Creates a new immutable member instance.
        Parameters:
        api - The api instance.
        server - The server of the member.
        data - The json data of the member.
        user - A user object in case the json does not contain user data (e.g., for message create events). If the json contains a non-null user field, this parameter is ignored.
    • Method Detail

      • setUser

        public MemberImpl setUser​(UserImpl user)
        Creates a new member object with the new user.
        Parameters:
        user - The new user.
        Returns:
        The new member.
      • setPartialUser

        public MemberImpl setPartialUser​(com.fasterxml.jackson.databind.JsonNode partialUserJson)
        Creates a new member object with the new partial user data.
        Parameters:
        partialUserJson - The new partial user data.
        Returns:
        The new member.
      • setRoleIds

        public MemberImpl setRoleIds​(List<Long> roleIds)
        Creates a new member object with the new role ids.
        Parameters:
        roleIds - The new role ids.
        Returns:
        The new member.
      • getRoleIds

        public List<Long> getRoleIds​()
        Gets a list with the member's role ids.
        Returns:
        A list with the member's role ids.
      • setNickname

        public MemberImpl setNickname​(String nickname)
        Creates a new member object with the new nickname.
        Parameters:
        nickname - The new nickname.
        Returns:
        The new member.
      • setServerBoostingSince

        public MemberImpl setServerBoostingSince​(String serverBoostingSince)
        Creates a new member object with the new nickname.
        Parameters:
        serverBoostingSince - The new timestamp when the user started boosting the server.
        Returns:
        The new member.
      • getServerBoostingSince

        public String getServerBoostingSince​()
        Gets the string value of the server boosting since field.
        Returns:
        The server boosting since field.
      • getServer

        public Server getServer​()
        Description copied from interface: Member
        Gets the server, this user is a part of.
        Specified by:
        getServer in interface Member
        Returns:
        The server.
      • getUser

        public User getUser​()
        Description copied from interface: Member
        Gets the user object linked to this member.
        Specified by:
        getUser in interface Member
        Returns:
        The user.
      • getNickname

        public Optional<String> getNickname​()
        Description copied from interface: Member
        Gets the nickname of this member.
        Specified by:
        getNickname in interface Member
        Returns:
        The nickname of this member.
      • getRoles

        public List<Role> getRoles​()
        Description copied from interface: Member
        Gets a sorted list (by position) with all roles of this member.
        Specified by:
        getRoles in interface Member
        Returns:
        A sorted list (by position) with all roles of this member.
      • hasRole

        public boolean hasRole​(Role role)
        Description copied from interface: Member
        Checks if this member has the given role.
        Specified by:
        hasRole in interface Member
        Parameters:
        role - The role to check.
        Returns:
        Whether the member has the role or not.
      • getRoleColor

        public Optional<Color> getRoleColor​()
        Description copied from interface: Member
        Gets the displayed color of this member based on his roles.
        Specified by:
        getRoleColor in interface Member
        Returns:
        The color.
      • getJoinedAtTimestamp

        public Instant getJoinedAtTimestamp​()
        Description copied from interface: Member
        Gets the timestamp of when this member joined the server.
        Specified by:
        getJoinedAtTimestamp in interface Member
        Returns:
        The timestamp of when this member joined the server.
      • getServerBoostingSinceTimestamp

        public Optional<Instant> getServerBoostingSinceTimestamp​()
        Description copied from interface: Member
        Gets the timestamp of when this member started boosting the server.
        Specified by:
        getServerBoostingSinceTimestamp in interface Member
        Returns:
        The timestamp of when this member started boosting joined the server.
      • isSelfMuted

        public boolean isSelfMuted​()
        Description copied from interface: Member
        Gets the self-muted state of this member.
        Specified by:
        isSelfMuted in interface Member
        Returns:
        Whether or not this member is self-muted.
      • isSelfDeafened

        public boolean isSelfDeafened​()
        Description copied from interface: Member
        Gets the self-deafened state of this member.
        Specified by:
        isSelfDeafened in interface Member
        Returns:
        Whether or not this member is self-deafened.