common / me.schlaubi.regnumutils.command.spi / Arguments

Arguments

interface Arguments : Iterable<String>

Representation of user provided input.

Properties

array

abstract val array: Array<String>

The args stored in a Array.

list

abstract val list: List<String>

The args stored in a List.

size

open val size: Int

The amount of arguments.

Functions

array

open fun array(from: Int, to: Int): List<String>

Returns all arguments from the beginning to as an Array.

open fun array(to: Int): List<String>

Returns all arguments from as an Array.

get

open operator fun get(index: Int): String

Returns the argument at the specified index.

isEmpty

open fun isEmpty(): Boolean

Whether there are arguments or not.

iterator

open operator fun iterator(): Iterator<String>

Returns an Iterator for all the arguments.

open fun iterator(from: Int, to: Int): Iterator<String>

Returns an Iterator for all arguments in the from range.

open fun iterator(to: Int): Iterator<String>

Returns an Iterator for all arguments in the 0 to range.

list

open fun list(from: Int, to: Int): List<String>

Returns all arguments from as a List.

open fun list(to: Int): List<String>

Returns all arguments from the beginning to as a List.

string

open fun string(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "..."): String

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

open fun string(from: Int, to: Int, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "..."): String

Uses from and to as its range. Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

open fun string(to: Int, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "..."): String

Uses from and to as its range. Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.