接口 Prompt
- 所有超级接口:
Cloneable
- 所有已知实现类:
BooleanPrompt,FixedSetPrompt,MessagePrompt,NumericPrompt,PlayerNamePrompt,RegexPrompt,StringPrompt,ValidatingPrompt
Prompt 是
Conversation 的主要组成部分。每个提示向用户显示文本,并可选择等待用户的响应。
提示链接成一个有向图,表示对话流程。要停止对话,返回 END_OF_CONVERSATION 代替另一个 Prompt 对象。-
字段概要
字段 -
方法概要
修饰符和类型方法说明acceptInput(@NotNull ConversationContext context, @Nullable String input) 接受并处理来自用户的输入。booleanblocksForInput(@NotNull ConversationContext context) 检查此提示实现是否应等待用户输入或立即显示下一个提示。getPromptText(@NotNull ConversationContext context) 获取首次呈现此提示时向用户显示的文本。
-
字段详细资料
-
END_OF_CONVERSATION
用于指示对话结束的便捷常量。原文: A convenience constant for indicating the end of a conversation.
-
-
方法详细资料
-
getPromptText
获取首次呈现此提示时向用户显示的文本。原文: Gets the text to display to the user when this prompt is first presented.
- 参数:
context- 关于对话的上下文信息。- 返回:
- 要显示的文本。
-
blocksForInput
检查此提示实现是否应等待用户输入或立即显示下一个提示。原文: Checks to see if this prompt implementation should wait for user input or immediately display the next prompt.
- 参数:
context- 关于对话的上下文信息。- 返回:
- 如果为 true,
Conversation将在继续之前等待输入。如果为 false,acceptInput(ConversationContext, String)将立即以null输入调用。
-
acceptInput
@Nullable @Nullable Prompt acceptInput(@NotNull @NotNull ConversationContext context, @Nullable @Nullable String input) 接受并处理来自用户的输入。使用输入,返回提示图中的下一个 Prompt。原文: Accepts and processes input from the user. Using the input, the next Prompt in the prompt graph is returned.
- 参数:
context- 关于对话的上下文信息。input- 来自用户的输入文本。- 返回:
- 提示图中的下一个 Prompt。
-