Class Occupant

    • Method Detail

      • getAffiliation

        public Affiliation getAffiliation()
        Gets the affiliation of the occupant.
        Returns:
        The affiliation.
      • getRole

        public Role getRole()
        Gets the role of the occupant.
        Returns:
        The role.
      • getJid

        public Jid getJid()
        Gets the JID of the occupant. Note that it can be null, if the room is (semi-)anonymous.
        Specified by:
        getJid in interface Addressable
        Returns:
        The JID or null for (semi-)anonymous rooms.
      • getNick

        public String getNick()
        Gets the nickname.
        Returns:
        The nickname.
      • getPresence

        public Presence getPresence()
        Gets the current presence of this occupant.
        Returns:
        The presence.
      • isSelf

        public boolean isSelf()
        If the occupant is yourself.
        Returns:
        True, if this occupant is you.
      • compareTo

        public int compareTo​(Occupant o)
        Compares this occupant with another occupant. Occupants are compared first by their affiliation, then by their role, then by their nickname.

        Affiliations and roles are ranked by their privileges, so that occupants with the most privileges are ranked higher.

        That means, in a sorted list of occupants, the owners are listed first, followed by the admins, followed by the mere members. Within each affiliation group, the moderators are listed first, followed by the participants and visitors. Each group is then sorted by its occupants' nicknames.

        Specified by:
        compareTo in interface Comparable<Occupant>
        Parameters:
        o - The other occupant.
        Returns:
        The comparison result.