Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ExactMatchConversationCanceller.java
1 package org.bukkit.conversations;
2 
3 /**
4  * An ExactMatchConversationCanceller cancels a conversation if the user
5  * enters an exact input string
6  */
8  private String escapeSequence;
9 
10  /**
11  * Builds an ExactMatchConversationCanceller.
12  *
13  * @param escapeSequence The string that, if entered by the user, will
14  * cancel the conversation.
15  */
16  public ExactMatchConversationCanceller(String escapeSequence) {
17  this.escapeSequence = escapeSequence;
18  }
19 
20  public void setConversation(Conversation conversation) {}
21 
22  public boolean cancelBasedOnInput(ConversationContext context, String input) {
23  return input.equals(escapeSequence);
24  }
25 
27  return new ExactMatchConversationCanceller(escapeSequence);
28  }
29 }
boolean cancelBasedOnInput(ConversationContext context, String input)