インターフェース Command
- すべての既知の実装クラス:
AbstractCommand、Clear、ConsumerCommandAdapter、FunctionCommandAdapter、Help、History、MethodInvokerCommandAdapter、Script、Version
- 関数インターフェース:
- これは関数インターフェースであるため、ラムダ式またはメソッド参照の割り当てターゲットとして使用できます。
- 作成者:
- Eric Bottard, Piotr Olaszewski, Mahmoud Ben Hassine
ネストされたクラスの要約
ネストされたクラス方法の概要
修飾子と型メソッド説明static Command.Builderbuilder()コマンドを定義および構築するためのBuilderの新しいインスタンスを作成して返します。execute(CommandContext commandContext) 指定されたコンテキスト内でコマンドを実行します。コマンドのエイリアスを取得します。default AvailabilityProviderコマンドの可用性プロバイダーを取得します。default CompletionProviderコマンドの補完プロバイダーを取得します。default StringSEコマンドの簡単な説明を取得します。default StringSEgetGroup()コマンドのグループを取得します。default StringSEgetHelp()コマンドのヘルプテキストを取得します。default StringSEgetName()コマンドの名前を取得します。default ListSE<CommandOption>コマンドのオプションを取得します。default booleanisHidden()コマンドが非表示になっているかどうかを確認します。
メソッドの詳細
getName
コマンドの名前を取得します。- 戻り値:
- コマンドの名前
getDescription
コマンドの簡単な説明を取得します。- 戻り値:
- コマンドの説明
getHelp
コマンドのヘルプテキストを取得します。- 戻り値:
- コマンドのヘルプテキスト
isHidden
default boolean isHidden()コマンドが非表示になっているかどうかを確認します。- 戻り値:
- コマンドが非表示の場合は true、そうでない場合は false
getGroup
コマンドのグループを取得します。- 戻り値:
- コマンドのグループ
getAliases
コマンドのエイリアスを取得します。- 戻り値:
- the aliases of the command
getOptions
コマンドのオプションを取得します。- 戻り値:
- the options of the command
getAvailabilityProvider
Get the availability provider of the command. Defaults to always available.- 戻り値:
- the availability provider of the command
getCompletionProvider
コマンドの補完プロバイダーを取得します。- 戻り値:
- the completion provider of the command
execute
指定されたコンテキスト内でコマンドを実行します。- パラメーター:
commandContext- コマンドのコンテキスト- 戻り値:
- コマンドの終了ステータス
- 例外:
ExceptionSE
builder
コマンドを定義および構築するためのBuilderの新しいインスタンスを作成して返します。The builder allows customization of command properties such as name, description, group, help text, aliases, and execution logic.
- 戻り値:
- a new
Builderinstance for configuring and creating commands