Enum Guild.Timeout

    • 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 name
        java.lang.NullPointerException - if the argument is null
      • getSeconds

        public int getSeconds()
        The amount of seconds represented by this Guild.Timeout.
        Returns:
        An positive non-negative int representing the timeout amount in seconds.
      • fromKey

        @Nonnull
        public static Guild.Timeout fromKey​(int seconds)
        Retrieves the Timeout based on the amount of seconds requested.
        If the seconds amount provided is not valid for Discord, an IllegalArgumentException will be thrown.
        Parameters:
        seconds - The amount of seconds before idle timeout.
        Returns:
        The Timeout related to the amount of seconds provided.
        Throws:
        java.lang.IllegalArgumentException - If the provided seconds is an invalid timeout amount.