Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.conversations.ConversationContext Class Reference

Public Member Functions

 ConversationContext (Plugin plugin, Conversable forWhom, Map< Object, Object > initialSessionData)
 
Plugin getPlugin ()
 
Conversable getForWhom ()
 
Object getSessionData (Object key)
 
void setSessionData (Object key, Object value)
 

Detailed Description

A ConversationContext provides continuity between nodes in the prompt graph by giving the developer access to the subject of the conversation and a generic map for storing values that are shared between all Prompt invocations.

Definition at line 13 of file ConversationContext.java.

Constructor & Destructor Documentation

org.bukkit.conversations.ConversationContext.ConversationContext ( Plugin  plugin,
Conversable  forWhom,
Map< Object, Object >  initialSessionData 
)
Parameters
pluginThe owning plugin.
forWhomThe subject of the conversation.
initialSessionDataAny initial values to put in the sessionData map.

Definition at line 24 of file ConversationContext.java.

24  {
25  this.plugin = plugin;
26  this.forWhom = forWhom;
27  this.sessionData = initialSessionData;
28  }

Member Function Documentation

Conversable org.bukkit.conversations.ConversationContext.getForWhom ( )
Plugin org.bukkit.conversations.ConversationContext.getPlugin ( )

Gets the plugin that owns this conversation.

Returns
The owning plugin.

Definition at line 35 of file ConversationContext.java.

35  {
36  return plugin;
37  }
Object org.bukkit.conversations.ConversationContext.getSessionData ( Object  key)

Gets session data shared between all Prompt invocations. Use this as a way to pass data through each Prompt as the conversation develops.

Parameters
keyThe session data key.
Returns
The requested session data.

Definition at line 56 of file ConversationContext.java.

56  {
57  return sessionData.get(key);
58  }
void org.bukkit.conversations.ConversationContext.setSessionData ( Object  key,
Object  value 
)

Sets session data shared between all Prompt invocations. Use this as a way to pass data through each prompt as the conversation develops.

Parameters
keyThe session data key.
valueThe session data value.

Definition at line 68 of file ConversationContext.java.

68  {
69  sessionData.put(key, value);
70  }

The documentation for this class was generated from the following file: