Class OptionBuilder

OptionBuilder

SelectSingleSelectMultiple のオプションを作成するためのビルダー。

var cc = DataStudioApp.createCommunityConnector();
var config = cc.getConfig();

var option1 = config.newOptionBuilder()
  .setLabel("option label")
  .setValue("option_value");

var option2 = config.newOptionBuilder()
  .setLabel("second option label")
  .setValue("option_value_2");

var info1 = config.newSelectSingle()
  .setId("api_endpoint")
  .setName("Data Type")
  .setHelpText("Select the data type you're interested in.")
  .addOption(option1)
  .addOption(option2);

Methods

メソッド戻り値の型概要
setLabel(label)OptionBuilderこのオプション ビルダーのラベルを設定します。
setValue(value)OptionBuilderこのオプション ビルダーの値を設定します。

詳細なドキュメント

setLabel(label)

このオプション ビルダーのラベルを設定します。ラベルは、ユーザーがプルダウンから 1 つ以上のオプションを選択したときに表示されるテキストです。

パラメータ

名前説明
labelString設定するラベル。

リターン

OptionBuilder - チェーン用のこのビルダー。


setValue(value)

このオプション ビルダーの値を設定します。値は、ユーザーがプルダウンから 1 つ以上のオプションを選択したときにコードに渡されます。

パラメータ

名前説明
valueString設定する値。

リターン

OptionBuilder - チェーン用のこのビルダー。