GraphMine

graphmine-core / io.github.sof3.graphmine.command / Overload

Overload

abstract class Overload

Defines the parameters of a command.

Commands that have parameters should create classes extending Overload. The subclass should contain backing properties delegated to one of the CommandArg factory methods like string, integer, etc.

If another module wants to implement its own CommandArg types, it can create extension functions on Overload that constructs the CommandArg, calls the addArg function and returns the new CommandArg instance.

Constructors

<init> Overload()
Defines the parameters of a command.

Functions

addArg fun <T : Any> addArg(arg: CommandArg<T>): CommandArg<T>
CommandArg factory extension functions must call this function before returning the argument
client fun client(): CommandArg<Client>
enum fun <E : Enum<E>> enum(): CommandArg<E>
fun <E : Enum<E>> enum(enumClass: KClass<E>): CommandArg<E>
integer fun integer(): CommandArg<Int>
number fun number(): CommandArg<Double>
rawText fun rawText(): CommandArg<String>
string fun string(): CommandArg<String>

Inheritors

EmptyOverload class EmptyOverload : Overload
An empty overload, reused for commands that do not require arguments.