public final class Occupant extends java.lang.Object implements java.lang.Comparable<Occupant>
The main actor in a multi-user chat environment is the occupant, who can be said to be located “in” a multi-user chat room and to participate in the discussions held in that room.
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Occupant o)
Compares this occupant with another occupant.
|
Affiliation |
getAffiliation()
Gets the affiliation of the occupant.
|
Jid |
getJid()
Gets the JID of the occupant.
|
java.lang.String |
getNick()
Gets the nickname.
|
Presence |
getPresence()
Gets the current presence of this occupant.
|
Role |
getRole()
Gets the role of the occupant.
|
boolean |
isSelf()
If the occupant is yourself.
|
java.lang.String |
toString() |
public Affiliation getAffiliation()
Gets the affiliation of the occupant.
public Role getRole()
Gets the role of the occupant.
public Jid getJid()
Gets the JID of the occupant. Note that it can be null, if the room is (semi-)anonymous.
public java.lang.String getNick()
Gets the nickname.
public Presence getPresence()
Gets the current presence of this occupant.
public boolean isSelf()
If the occupant is yourself.
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.
compareTo
in interface java.lang.Comparable<Occupant>
o
- The other occupant.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2019 XMPP.rocks. All rights reserved.