DialogContainer 類別

public abstract class DialogContainer
extends Dialog

一組對話框的容器。

建構函式摘要

建構函式 Description
DialogContainer()

建立具有預設對話框識別碼的新實例。

DialogContainer(String dialogId)

建立具有預設對話框識別碼的新實例。

方法摘要

修飾詞與類型 方法與描述
protected java.util.concurrent.CompletableFuture<java.lang.Void> checkForVersionChange(DialogContext dc)

檢查容器子對話是否在啟動目前對話實例之後已變更。

abstract DialogContext createChildContext(DialogContext dc)

建立容器使用中子系的內部對話內容。

Dialog findDialog(String dialogId)

搜尋目前的對話框依其標識碼設定對話方塊。

DialogSet getDialogs()

傳回對話框做為對話框集。

protected java.lang.String getInternalVersion()

傳回此容器的內部版本標識碼。

java.util.concurrent.CompletableFuture<java.lang.Boolean> onDialogEvent(DialogContext dc, DialogEvent e)

使用 『DialogContext 引發事件時呼叫。發出Event()』,方法是目前的對話框或目前對話框啟動的對話方塊。

void setTelemetryClient(BotTelemetryClient withTelemetryClient)

將 Bot遙測客戶端設定為用於記錄。

方法繼承來源 Dialog

方法繼承來源 java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

建構函式詳細資料

DialogContainer

public DialogContainer()

建立具有預設對話框識別碼的新實例。

DialogContainer

public DialogContainer(String dialogId)

建立具有預設對話框識別碼的新實例。

參數:

dialogId - 對話框的識別碼。

方法詳細資料

checkForVersionChange

protected CompletableFuture checkForVersionChange(DialogContext dc)

檢查容器子對話是否在啟動目前對話實例之後已變更。 這應該在 'beginDialog()'、'continueDialog()' 和 'resumeDialog()' 開頭呼叫。

參數:

dc - 對話框內容

傳回:

CompletableFuture

createChildContext

public abstract DialogContext createChildContext(DialogContext dc)

建立容器使用中子系的內部對話內容。

參數:

dc - 父代對話框內容。

傳回:

作用中子系的新對話框內容。

findDialog

public Dialog findDialog(String dialogId)

依其標識子搜尋目前 DialogSet 中的對話方塊。

參數:

dialogId - 要搜尋之對話框的標識碼。

傳回:

如果找到對話框,則為 ;否則為 null

getDialogs

public DialogSet getDialogs()

傳回 Dialogs 做為 DialogSet。

傳回:

對話框的 DialogSet。

getInternalVersion

protected String getInternalVersion()

傳回此容器的內部版本標識碼。

DialogContainers 會偵測容器中所有子元件的變更,並將其對應至 DialogChanged 事件。 因為它們這樣做,DialogContainers 會「隱藏」內部變更,而且只有 .id。除非容器未處理容器,否則這會隔離容器層級的變更。 為了支援此 DialogContainers 會定義受保護的虛擬方法 getInternalVersion(),其會計算此對話框或子對話是否已變更,然後透過 checkForVersionChange() 的呼叫來檢查。

傳回:

version,表示此容器內部的變更。

onDialogEvent

public CompletableFuture onDialogEvent(DialogContext dc, DialogEvent e)

當事件引發時,使用 『DialogContext.emitEvent()』,由目前對話或目前對話啟動的對話框呼叫。

此覆寫會追蹤版本變更。

覆寫:

DialogContainer.onDialogEvent(DialogContext dc, DialogEvent e)

參數:

dc - 目前交談回合的對話內容。
e - 要引發的事件。

傳回:

True 是表示 如果事件是由目前的對話框處理,且反升應該停止。

setTelemetryClient

public void setTelemetryClient(BotTelemetryClient withTelemetryClient)

設定要用於記錄的 BotTelemetryClient。 設定此屬性時,也會設定所有包含對話框的 BotTelemetryClient 屬性。

覆寫:

DialogContainer.setTelemetryClient(BotTelemetryClient withTelemetryClient)

參數:

withTelemetryClient - 要用於記錄的 BotTelemetryClient。

適用於