CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.LiteralArgument Class Reference

A pseudo-argument representing a single literal string. More...

+ Inheritance diagram for dev.jorel.commandapi.arguments.LiteralArgument:

Public Member Functions

 LiteralArgument (final String literal)
 A literal argument. More...
 
 LiteralArgument (String nodeName, final String literal)
 A literal argument. More...
 
Class< String > getPrimitiveType ()
 
String getLiteral ()
 Returns the literal string represented by this argument. More...
 
CommandAPIArgumentType getArgumentType ()
 
String getHelpString ()
 
Argument< T > instance ()
 Returns the instance of this class with the class Impl. More...
 

Static Public Member Functions

static LiteralArgument of (final String literal)
 A utility method to create a literal argument. More...
 
static LiteralArgument literal (final String literal)
 A utility method to create a literal argument. More...
 
static LiteralArgument of (String nodeName, final String literal)
 A utility method to create a literal argument. More...
 
static LiteralArgument literal (String nodeName, final String literal)
 A utility method to create a literal argument. More...
 

Detailed Description

A pseudo-argument representing a single literal string.

Since
1.3

Constructor & Destructor Documentation

◆ LiteralArgument() [1/2]

dev.jorel.commandapi.arguments.LiteralArgument.LiteralArgument ( final String  literal)

A literal argument.

Only takes one string value which cannot be modified

Parameters
literalthe string literal that this argument will represent. Also acts as this argument's node name

◆ LiteralArgument() [2/2]

dev.jorel.commandapi.arguments.LiteralArgument.LiteralArgument ( String  nodeName,
final String  literal 
)

A literal argument.

Only takes one string value which cannot be modified

Parameters
nodeNamethe node name for this argument
literalthe string literal that this argument will represent

Member Function Documentation

◆ getLiteral()

String dev.jorel.commandapi.arguments.LiteralArgument.getLiteral ( )

Returns the literal string represented by this argument.

Returns
the literal string represented by this argument

◆ instance()

Argument< T > dev.jorel.commandapi.arguments.Argument< T >.instance ( )
inherited

Returns the instance of this class with the class Impl.

Used for chaining builder methods.

◆ literal() [1/2]

static LiteralArgument dev.jorel.commandapi.arguments.LiteralArgument.literal ( final String  literal)
static

A utility method to create a literal argument.

Works as an alternative to dev.jorel.commandapi.arguments.LiteralArgument#of(String)

To provide easier use of this method you can statically import this: import static dev.jorel.commandapi.arguments.LiteralArgument.literal;

Parameters
literalthe string literal that this argument will represent
Returns
the literal argument created by this method

◆ literal() [2/2]

static LiteralArgument dev.jorel.commandapi.arguments.LiteralArgument.literal ( String  nodeName,
final String  literal 
)
static

A utility method to create a literal argument.

Works as an alternative to dev.jorel.commandapi.arguments.LiteralArgument#of(String, String)

To provide easier use of this method you can statically import this: import static dev.jorel.commandapi.arguments.LiteralArgument.literal;

Parameters
literalthe string literal that this argument will represent
Returns
the literal argument created by this method

◆ of() [1/2]

static LiteralArgument dev.jorel.commandapi.arguments.LiteralArgument.of ( final String  literal)
static

A utility method to create a literal argument.

Works as an alternative to dev.jorel.commandapi.arguments.LiteralArgument#literal(String)

To provide easier use of this method you can statically import this: import static dev.jorel.commandapi.arguments.LiteralArgument.of;

Parameters
literalthe string literal that this argument will represent
Returns
the literal argument created by this method

◆ of() [2/2]

static LiteralArgument dev.jorel.commandapi.arguments.LiteralArgument.of ( String  nodeName,
final String  literal 
)
static

A utility method to create a literal argument.

Works as an alternative to dev.jorel.commandapi.arguments.LiteralArgument#literal(String, String)

To provide easier use of this method you can statically import this: import static dev.jorel.commandapi.arguments.LiteralArgument.of;

Parameters
literalthe string literal that this argument will represent
Returns
the literal argument created by this method