Package org.javacord.api.entity.user
Enum UserStatus
- java.lang.Object
-
- java.lang.Enum<UserStatus>
-
- org.javacord.api.entity.user.UserStatus
-
- All Implemented Interfaces:
Serializable,Comparable<UserStatus>
public enum UserStatus extends Enum<UserStatus>
An enum which contains all user status.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DO_NOT_DISTURBThe user is dnd.IDLEThe user is idle.INVISIBLEThe user is invisible.OFFLINEThs user is offline.ONLINEThe user is online.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserStatusfromString(String str)Gets the status from the given string.StringgetStatusString()Gets the status string of the status.static UserStatusvalueOf(String name)Returns the enum constant of this type with the specified name.static UserStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ONLINE
public static final UserStatus ONLINE
The user is online.
-
IDLE
public static final UserStatus IDLE
The user is idle.
-
DO_NOT_DISTURB
public static final UserStatus DO_NOT_DISTURB
The user is dnd.
-
INVISIBLE
public static final UserStatus INVISIBLE
The user is invisible. You cannot tell if a user is offline or invisible! This is only used to change your own status, but you will never see an other user marked as invisible.
-
OFFLINE
public static final UserStatus OFFLINE
Ths user is offline.
-
-
Method Detail
-
values
public static UserStatus[] 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 (UserStatus c : UserStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UserStatus 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
-
getStatusString
public String getStatusString()
Gets the status string of the status.- Returns:
- The status string of the status.
-
fromString
public static UserStatus fromString(String str)
Gets the status from the given string.- Parameters:
str- The string, e.g. "online".- Returns:
- The status or
OFFLINEif unknown string.
-
-