Package net.dv8tion.jda.api.entities
Enum Guild.Timeout
- java.lang.Object
-
- java.lang.Enum<Guild.Timeout>
-
- net.dv8tion.jda.api.entities.Guild.Timeout
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Guild.Timeout>
- Enclosing interface:
- Guild
public static enum Guild.Timeout extends java.lang.Enum<Guild.Timeout>
Represents the idle time allowed until a user is moved to the AFKVoiceChannelif one is set (Guild.getAfkChannel()).
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SECONDS_1800SECONDS_300SECONDS_3600SECONDS_60SECONDS_900
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Guild.TimeoutfromKey(int seconds)Retrieves theTimeoutbased on the amount of seconds requested.intgetSeconds()The amount of seconds represented by thisGuild.Timeout.static Guild.TimeoutvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Guild.Timeout[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SECONDS_60
public static final Guild.Timeout SECONDS_60
-
SECONDS_300
public static final Guild.Timeout SECONDS_300
-
SECONDS_900
public static final Guild.Timeout SECONDS_900
-
SECONDS_1800
public static final Guild.Timeout SECONDS_1800
-
SECONDS_3600
public static final Guild.Timeout SECONDS_3600
-
-
Method Detail
-
values
public static Guild.Timeout[] 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 (Guild.Timeout c : Guild.Timeout.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Guild.Timeout valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getSeconds
public int getSeconds()
The amount of seconds represented by thisGuild.Timeout.- Returns:
- An positive non-negative int representing the timeout amount in seconds.
-
fromKey
@Nonnull public static Guild.Timeout fromKey(int seconds)
Retrieves theTimeoutbased on the amount of seconds requested.
If thesecondsamount provided is not valid for Discord, an IllegalArgumentException will be thrown.- Parameters:
seconds- The amount of seconds before idle timeout.- Returns:
- The
Timeoutrelated to the amount of seconds provided. - Throws:
java.lang.IllegalArgumentException- If the providedsecondsis an invalid timeout amount.
-
-