Package rocks.xmpp.extensions.muc.model
Enum Role
- java.lang.Object
-
- java.lang.Enum<Role>
-
- rocks.xmpp.extensions.muc.model.Role
-
- All Implemented Interfaces:
Serializable
,Comparable<Role>
public enum Role extends Enum<Role>
A temporary position or privilege level within a room, distinct from a user's long-lived affiliation with the room; the possible roles are "moderator", "participant", and "visitor" (it is also possible to have no defined role). A role lasts only for the duration of an occupant's visit to a room.- See Also:
- 5.1 Roles
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MODERATOR
The moderator role.NONE
No role.PARTICIPANT
The participant role.VISITOR
The visitor role.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isHigherThan(Role role)
Compares two roles and returns true, if this role is higher than the other with regards to their privileges in a multi-user chat.static Role
valueOf(String name)
Returns the enum constant of this type with the specified name.static Role[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Role[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Role c : Role.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Role valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isHigherThan
public final boolean isHigherThan(Role role)
Compares two roles and returns true, if this role is higher than the other with regards to their privileges in a multi-user chat.The highest role is moderator, followed by participant, followed by visitor, followed by none.
- Parameters:
role
- The other role.- Returns:
- True, if this role is higher than the other.
-
-