Class TabCompletionContext
java.lang.Object
com.ultikits.ultitools.commands.tabcomplete.TabCompletionContext
Immutable input metadata for a parameter's completion provider.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current partial token.org.bukkit.entity.PlayerReturns the player when this completion originated from one.org.bukkit.command.CommandSenderReturns the requesting sender, including contexts built with the player setter.booleaninputStartsWith(String prefix) Checks the current token's prefix without case sensitivity.static TabCompletionContextCreates a completion context without a Bukkit command object.
-
Field Details
-
sender
private final org.bukkit.command.CommandSender sender -
player
private final org.bukkit.entity.Player player -
commandName
-
args
-
currentArgIndex
private final int currentArgIndex -
partialArg
-
matchedMethod
-
parameterName
-
executorInstance
-
-
Constructor Details
-
TabCompletionContext
public TabCompletionContext()
-
-
Method Details
-
getSender
public org.bukkit.command.CommandSender getSender()Returns the requesting sender, including contexts built with the player setter.- Returns:
- the sender, or null when none was supplied
-
getPlayer
public org.bukkit.entity.Player getPlayer()Returns the player when this completion originated from one.- Returns:
- the player, or null for another sender kind
-
getCurrentInput
Gets the current partial token.- Returns:
- the partial token, or an empty string
-
inputStartsWith
Checks the current token's prefix without case sensitivity.- Parameters:
prefix- the candidate prefix- Returns:
- whether the token starts with that prefix
-
of
public static TabCompletionContext of(org.bukkit.command.CommandSender sender, String commandName, String[] args) Creates a completion context without a Bukkit command object.- Parameters:
sender- the requesting sendercommandName- the primary root labelargs- input tokens including the partial final token- Returns:
- a new context
-