Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Prompt.java
1 package org.bukkit.conversations;
2 
3 /**
4  * A Prompt is the main constituent of a {@link Conversation}. Each prompt
5  * displays text to the user and optionally waits for a user's response.
6  * Prompts are chained together into a directed graph that represents the
7  * conversation flow. To halt a conversation, END_OF_CONVERSATION is returned
8  * in liu of another Prompt object.
9  */
10 public interface Prompt extends Cloneable {
11 
12  /**
13  * A convenience constant for indicating the end of a conversation.
14  */
15  static final Prompt END_OF_CONVERSATION = null;
16 
17  /**
18  * Gets the text to display to the user when this prompt is first
19  * presented.
20  *
21  * @param context Context information about the conversation.
22  * @return The text to display.
23  */
24  String getPromptText(ConversationContext context);
25 
26  /**
27  * Checks to see if this prompt implementation should wait for user input
28  * or immediately display the next prompt.
29  *
30  * @param context Context information about the conversation.
31  * @return If true, the {@link Conversation} will wait for input before
32  * continuing.
33  */
34  boolean blocksForInput(ConversationContext context);
35 
36  /**
37  * Accepts and processes input from the user. Using the input, the next
38  * Prompt in the prompt graph is returned.
39  *
40  * @param context Context information about the conversation.
41  * @param input The input text from the user.
42  * @return The next Prompt in the prompt graph.
43  */
44  Prompt acceptInput(ConversationContext context, String input);
45 }
static final Prompt END_OF_CONVERSATION
Definition: Prompt.java:15
boolean blocksForInput(ConversationContext context)
String getPromptText(ConversationContext context)
Prompt acceptInput(ConversationContext context, String input)