Package top.focess.qq.api.command
Class Command.Executor
- java.lang.Object
-
- top.focess.qq.api.command.Command.Executor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CommandgetCommand()Get the command this Executor belongs to@NotNull Command.ExecutoroverrideExecutorPermission(@NotNull java.util.function.Predicate<CommandSender> executorPermission)Set the executor permission check for this Executor When execute this Executor, it will only check the executorPermission@NotNull Command.ExecutorremoveExecutorPermission()Remove the executor permission check for this Executor@NotNull Command.ExecutorsetCommandResultExecutors(@NotNull CommandResult result, @NotNull CommandResultExecutor executor)Set the executor of the special CommandResult after executing this Executor@NotNull Command.ExecutorsetDataConverters(@NotNull DataConverter<?>... dataConverters)Set the DataConverters for the arguments.@NotNull Command.ExecutorsetExecutorPermission(@NotNull java.util.function.Predicate<CommandSender> executorPermission)Set the executor permission check for this Executor When execute this Executor, it will checkCommand.executorPermissionand the executorPermission@NotNull Command.ExecutorsetPermission(@NotNull net.mamoe.mirai.contact.MemberPermission permission)Deprecated.@NotNull Command.ExecutorsetPermission(@NotNull CommandPermission permission)Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)@NotNull Command.ExecutorsetUseDefaultConverter(boolean flag)Set whether force use theDataConverter.DEFAULT_DATA_CONVERTERor not.
-
-
-
Method Detail
-
setPermission
@NotNull @Deprecated public @NotNull Command.Executor setPermission(@NotNull @NotNull net.mamoe.mirai.contact.MemberPermission permission)
Deprecated.Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)- Parameters:
permission- the executor Mirai Permission- Returns:
- the Executor itself
-
setPermission
@NotNull public @NotNull Command.Executor setPermission(@NotNull @NotNull CommandPermission permission)
Set the executor Mirai Permission (Only if the CommandSender has the command that this executor belongs to and this executor's permissions, this executor runs)- Parameters:
permission- the executor Mirai Permission- Returns:
- the Executor itself
-
setCommandResultExecutors
@NotNull public @NotNull Command.Executor setCommandResultExecutors(@NotNull @NotNull CommandResult result, @NotNull @NotNull CommandResultExecutor executor)
Set the executor of the special CommandResult after executing this Executor- Parameters:
result- the target CommandResultexecutor- the executor of the special CommandResult- Returns:
- the Executor itself
-
setDataConverters
@NotNull public @NotNull Command.Executor setDataConverters(@NotNull @NotNull DataConverter<?>... dataConverters)
Set the DataConverters for the arguments. Only ifsetUseDefaultConverter(boolean)is set false, this method will influence the DataCollection parser.- Parameters:
dataConverters- used to parser arguments this executor needs.- Returns:
- the Executor itself
- See Also:
setUseDefaultConverter(boolean)
-
setUseDefaultConverter
@NotNull public @NotNull Command.Executor setUseDefaultConverter(boolean flag)
Set whether force use theDataConverter.DEFAULT_DATA_CONVERTERor not. If this is set true, the influence bysetDataConverters(DataConverter[])is ignored.- Parameters:
flag- true force use theDataConverter.DEFAULT_DATA_CONVERTER, false ignore it- Returns:
- the Executor itself
- See Also:
setDataConverters(DataConverter[])
-
setExecutorPermission
@NotNull public @NotNull Command.Executor setExecutorPermission(@NotNull @NotNull java.util.function.Predicate<CommandSender> executorPermission)
Set the executor permission check for this Executor When execute this Executor, it will checkCommand.executorPermissionand the executorPermission- Parameters:
executorPermission- the executor permission check for this Executor- Returns:
- the Executor self
-
removeExecutorPermission
@NotNull public @NotNull Command.Executor removeExecutorPermission()
Remove the executor permission check for this Executor- Returns:
- the Executor self
-
overrideExecutorPermission
@NotNull public @NotNull Command.Executor overrideExecutorPermission(@NotNull @NotNull java.util.function.Predicate<CommandSender> executorPermission)
Set the executor permission check for this Executor When execute this Executor, it will only check the executorPermission- Parameters:
executorPermission- the executor permission check for this Executor- Returns:
- the Executor self
-
getCommand
public Command getCommand()
Get the command this Executor belongs to- Returns:
- the command this Executor belongs to
-
-