Class ArgumentList

java.lang.Object
com.github.alex1304.ultimategdbot.api.command.ArgumentList

public class ArgumentList
extends Object
Represents the list of the arguments of a command.
  • Constructor Details

  • Method Details

    • tokenCount

      public int tokenCount()
      Gets the number of tokens (arguments) present in the list.
      Returns:
      the token count
    • get

      public String get​(int position)
      Returns the argument at the specified position.
      Parameters:
      position - the position of the argument
      Returns:
      the argument at the specified position
      Throws:
      IndexOutOfBoundsException - if the position is out of bounds
    • getAllAfter

      public String getAllAfter​(int position)
      Gets all arguments from the specified position to the last one, into one String resulting of the concatenation of all arguments (separated with a whitespace). Specifying a position <= 0 returns all arguments. Specifying a position >= tokenCount will result in an empty String.
      Parameters:
      position - the position of the first arguments
      Returns:
      all arguments into one concatenated String
    • getTokens

      public List<String> getTokens()
    • getTokens

      public List<String> getTokens​(int maxCount)
    • toString

      public String toString()
      Overrides:
      toString in class Object