程序包 org.bukkit.conversations

# 类 ConversationContext

java.lang.Object
org.bukkit.conversations.ConversationContext

public class ConversationContext extends Object
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.

- ## 构造器概要

  构造器
  构造器
  说明
  `ConversationContext(@Nullable Plugin plugin, @NotNull Conversable forWhom, @NotNull Map<Object,Object> initialSessionData)`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull Map<Object,Object>`
  `getAllSessionData()`
  Gets the underlying sessionData map.
  `@NotNull Conversable`
  `getForWhom()`
  Gets the subject of the conversation.
  `@Nullable Plugin`
  `getPlugin()`
  Gets the plugin that owns this conversation.
  `@Nullable Object`
  `getSessionData(@NotNull Object key)`
  Gets session data shared between all `Prompt` invocations.
  `void`
  `setSessionData(@NotNull Object key, @Nullable Object value)`
  Sets session data shared between all `Prompt` invocations.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 构造器详细资料

  - ### ConversationContext

    public ConversationContext(@Nullable @Nullable Plugin plugin, @NotNull @NotNull Conversable forWhom, @NotNull @NotNull Map<Object,Object> initialSessionData)
    参数:
      `plugin` - The owning plugin.
      `forWhom` - The subject of the conversation.
      `initialSessionData` - Any initial values to put in the sessionData map.

- ## 方法详细资料

  - ### getPlugin

    @Nullable public @Nullable Plugin getPlugin()
    Gets the plugin that owns this conversation.
    返回:
      The owning plugin.

  - ### getForWhom

    @NotNull public @NotNull Conversable getForWhom()
    Gets the subject of the conversation.
    返回:
      The subject of the conversation.

  - ### getAllSessionData

    @NotNull public @NotNull Map<Object,Object> getAllSessionData()
    Gets the underlying sessionData map. May be directly modified to manipulate session data.
    返回:
      The full sessionData map.

  - ### getSessionData

    @Nullable public @Nullable Object getSessionData(@NotNull @NotNull 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.
    参数:
      `key` - The session data key.
    返回:
      The requested session data.

  - ### setSessionData

    public void setSessionData(@NotNull @NotNull Object key, @Nullable @Nullable 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.
    参数:
      `key` - The session data key.
      `value` - The session data value.