Class DecoratedText.Builder (2.39.0)

public static final class DecoratedText.Builder extends GeneratedMessageV3.Builder<DecoratedText.Builder> implements DecoratedTextOrBuilder

A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see Display text with decorative text.

Google Workspace Add-ons and Chat apps:

Protobuf type google.apps.card.v1.DecoratedText

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DecoratedText.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DecoratedText.Builder
Overrides

build()

public DecoratedText build()
Returns
Type Description
DecoratedText

buildPartial()

public DecoratedText buildPartial()
Returns
Type Description
DecoratedText

clear()

public DecoratedText.Builder clear()
Returns
Type Description
DecoratedText.Builder
Overrides

clearBottomLabel()

public DecoratedText.Builder clearBottomLabel()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

clearButton()

public DecoratedText.Builder clearButton()

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Returns
Type Description
DecoratedText.Builder

clearControl()

public DecoratedText.Builder clearControl()
Returns
Type Description
DecoratedText.Builder

clearEndIcon()

public DecoratedText.Builder clearEndIcon()

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Returns
Type Description
DecoratedText.Builder

clearField(Descriptors.FieldDescriptor field)

public DecoratedText.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
DecoratedText.Builder
Overrides

clearIcon() (deprecated)

public DecoratedText.Builder clearIcon()

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Returns
Type Description
DecoratedText.Builder

clearOnClick()

public DecoratedText.Builder clearOnClick()

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Returns
Type Description
DecoratedText.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public DecoratedText.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
DecoratedText.Builder
Overrides

clearStartIcon()

public DecoratedText.Builder clearStartIcon()

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Returns
Type Description
DecoratedText.Builder

clearSwitchControl()

public DecoratedText.Builder clearSwitchControl()

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Returns
Type Description
DecoratedText.Builder

clearText()

public DecoratedText.Builder clearText()

Required. The primary text.

Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string text = 4;

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

clearTopLabel()

public DecoratedText.Builder clearTopLabel()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

clearWrapText()

public DecoratedText.Builder clearWrapText()

The wrap text setting. If true, the text wraps and displays on multiple lines. Otherwise, the text is truncated.

Only applies to text, not topLabel and bottomLabel.

bool wrap_text = 5;

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

clone()

public DecoratedText.Builder clone()
Returns
Type Description
DecoratedText.Builder
Overrides

getBottomLabel()

public String getBottomLabel()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
Type Description
String

The bottomLabel.

getBottomLabelBytes()

public ByteString getBottomLabelBytes()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
Type Description
ByteString

The bytes for bottomLabel.

getButton()

public Button getButton()

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Returns
Type Description
Button

The button.

getButtonBuilder()

public Button.Builder getButtonBuilder()

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Returns
Type Description
Button.Builder

getButtonOrBuilder()

public ButtonOrBuilder getButtonOrBuilder()

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Returns
Type Description
ButtonOrBuilder

getControlCase()

public DecoratedText.ControlCase getControlCase()
Returns
Type Description
DecoratedText.ControlCase

getDefaultInstanceForType()

public DecoratedText getDefaultInstanceForType()
Returns
Type Description
DecoratedText

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEndIcon()

public Icon getEndIcon()

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Returns
Type Description
Icon

The endIcon.

getEndIconBuilder()

public Icon.Builder getEndIconBuilder()

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Returns
Type Description
Icon.Builder

getEndIconOrBuilder()

public IconOrBuilder getEndIconOrBuilder()

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Returns
Type Description
IconOrBuilder

getIcon() (deprecated)

public Icon getIcon()

Deprecated. google.apps.card.v1.DecoratedText.icon is deprecated. See google/apps/card/v1/card.proto;l=796

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Returns
Type Description
Icon

The icon.

getIconBuilder() (deprecated)

public Icon.Builder getIconBuilder()

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Returns
Type Description
Icon.Builder

getIconOrBuilder() (deprecated)

public IconOrBuilder getIconOrBuilder()

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Returns
Type Description
IconOrBuilder

getOnClick()

public OnClick getOnClick()

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Returns
Type Description
OnClick

The onClick.

getOnClickBuilder()

public OnClick.Builder getOnClickBuilder()

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Returns
Type Description
OnClick.Builder

getOnClickOrBuilder()

public OnClickOrBuilder getOnClickOrBuilder()

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Returns
Type Description
OnClickOrBuilder

getStartIcon()

public Icon getStartIcon()

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Returns
Type Description
Icon

The startIcon.

getStartIconBuilder()

public Icon.Builder getStartIconBuilder()

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Returns
Type Description
Icon.Builder

getStartIconOrBuilder()

public IconOrBuilder getStartIconOrBuilder()

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Returns
Type Description
IconOrBuilder

getSwitchControl()

public DecoratedText.SwitchControl getSwitchControl()

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Returns
Type Description
DecoratedText.SwitchControl

The switchControl.

getSwitchControlBuilder()

public DecoratedText.SwitchControl.Builder getSwitchControlBuilder()

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Returns
Type Description
DecoratedText.SwitchControl.Builder

getSwitchControlOrBuilder()

public DecoratedText.SwitchControlOrBuilder getSwitchControlOrBuilder()

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Returns
Type Description
DecoratedText.SwitchControlOrBuilder

getText()

public String getText()

Required. The primary text.

Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string text = 4;

Returns
Type Description
String

The text.

getTextBytes()

public ByteString getTextBytes()

Required. The primary text.

Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string text = 4;

Returns
Type Description
ByteString

The bytes for text.

getTopLabel()

public String getTopLabel()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
Type Description
String

The topLabel.

getTopLabelBytes()

public ByteString getTopLabelBytes()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
Type Description
ByteString

The bytes for topLabel.

getWrapText()

public boolean getWrapText()

The wrap text setting. If true, the text wraps and displays on multiple lines. Otherwise, the text is truncated.

Only applies to text, not topLabel and bottomLabel.

bool wrap_text = 5;

Returns
Type Description
boolean

The wrapText.

hasButton()

public boolean hasButton()

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Returns
Type Description
boolean

Whether the button field is set.

hasEndIcon()

public boolean hasEndIcon()

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Returns
Type Description
boolean

Whether the endIcon field is set.

hasIcon() (deprecated)

public boolean hasIcon()

Deprecated. google.apps.card.v1.DecoratedText.icon is deprecated. See google/apps/card/v1/card.proto;l=796

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Returns
Type Description
boolean

Whether the icon field is set.

hasOnClick()

public boolean hasOnClick()

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Returns
Type Description
boolean

Whether the onClick field is set.

hasStartIcon()

public boolean hasStartIcon()

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Returns
Type Description
boolean

Whether the startIcon field is set.

hasSwitchControl()

public boolean hasSwitchControl()

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Returns
Type Description
boolean

Whether the switchControl field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeButton(Button value)

public DecoratedText.Builder mergeButton(Button value)

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Parameter
Name Description
value Button
Returns
Type Description
DecoratedText.Builder

mergeEndIcon(Icon value)

public DecoratedText.Builder mergeEndIcon(Icon value)

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

mergeFrom(DecoratedText other)

public DecoratedText.Builder mergeFrom(DecoratedText other)
Parameter
Name Description
other DecoratedText
Returns
Type Description
DecoratedText.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DecoratedText.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public DecoratedText.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
DecoratedText.Builder
Overrides

mergeIcon(Icon value) (deprecated)

public DecoratedText.Builder mergeIcon(Icon value)

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

mergeOnClick(OnClick value)

public DecoratedText.Builder mergeOnClick(OnClick value)

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Parameter
Name Description
value OnClick
Returns
Type Description
DecoratedText.Builder

mergeStartIcon(Icon value)

public DecoratedText.Builder mergeStartIcon(Icon value)

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

mergeSwitchControl(DecoratedText.SwitchControl value)

public DecoratedText.Builder mergeSwitchControl(DecoratedText.SwitchControl value)

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Parameter
Name Description
value DecoratedText.SwitchControl
Returns
Type Description
DecoratedText.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DecoratedText.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DecoratedText.Builder
Overrides

setBottomLabel(String value)

public DecoratedText.Builder setBottomLabel(String value)

The text that appears below text. Always wraps.

string bottom_label = 6;

Parameter
Name Description
value String

The bottomLabel to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setBottomLabelBytes(ByteString value)

public DecoratedText.Builder setBottomLabelBytes(ByteString value)

The text that appears below text. Always wraps.

string bottom_label = 6;

Parameter
Name Description
value ByteString

The bytes for bottomLabel to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setButton(Button value)

public DecoratedText.Builder setButton(Button value)

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Parameter
Name Description
value Button
Returns
Type Description
DecoratedText.Builder

setButton(Button.Builder builderForValue)

public DecoratedText.Builder setButton(Button.Builder builderForValue)

A button that a user can click to trigger an action.

.google.apps.card.v1.Button button = 8;

Parameter
Name Description
builderForValue Button.Builder
Returns
Type Description
DecoratedText.Builder

setEndIcon(Icon value)

public DecoratedText.Builder setEndIcon(Icon value)

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

setEndIcon(Icon.Builder builderForValue)

public DecoratedText.Builder setEndIcon(Icon.Builder builderForValue)

An icon displayed after the text.

Supports built-in and custom icons.

.google.apps.card.v1.Icon end_icon = 11;

Parameter
Name Description
builderForValue Icon.Builder
Returns
Type Description
DecoratedText.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public DecoratedText.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
DecoratedText.Builder
Overrides

setIcon(Icon value) (deprecated)

public DecoratedText.Builder setIcon(Icon value)

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

setIcon(Icon.Builder builderForValue) (deprecated)

public DecoratedText.Builder setIcon(Icon.Builder builderForValue)

Deprecated in favor of startIcon.

.google.apps.card.v1.Icon icon = 1 [deprecated = true];

Parameter
Name Description
builderForValue Icon.Builder
Returns
Type Description
DecoratedText.Builder

setOnClick(OnClick value)

public DecoratedText.Builder setOnClick(OnClick value)

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Parameter
Name Description
value OnClick
Returns
Type Description
DecoratedText.Builder

setOnClick(OnClick.Builder builderForValue)

public DecoratedText.Builder setOnClick(OnClick.Builder builderForValue)

This action is triggered when users click topLabel or bottomLabel.

.google.apps.card.v1.OnClick on_click = 7;

Parameter
Name Description
builderForValue OnClick.Builder
Returns
Type Description
DecoratedText.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public DecoratedText.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
DecoratedText.Builder
Overrides

setStartIcon(Icon value)

public DecoratedText.Builder setStartIcon(Icon value)

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Parameter
Name Description
value Icon
Returns
Type Description
DecoratedText.Builder

setStartIcon(Icon.Builder builderForValue)

public DecoratedText.Builder setStartIcon(Icon.Builder builderForValue)

The icon displayed in front of the text.

.google.apps.card.v1.Icon start_icon = 12;

Parameter
Name Description
builderForValue Icon.Builder
Returns
Type Description
DecoratedText.Builder

setSwitchControl(DecoratedText.SwitchControl value)

public DecoratedText.Builder setSwitchControl(DecoratedText.SwitchControl value)

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Parameter
Name Description
value DecoratedText.SwitchControl
Returns
Type Description
DecoratedText.Builder

setSwitchControl(DecoratedText.SwitchControl.Builder builderForValue)

public DecoratedText.Builder setSwitchControl(DecoratedText.SwitchControl.Builder builderForValue)

A switch widget that a user can click to change its state and trigger an action.

.google.apps.card.v1.DecoratedText.SwitchControl switch_control = 9;

Parameter
Name Description
builderForValue DecoratedText.SwitchControl.Builder
Returns
Type Description
DecoratedText.Builder

setText(String value)

public DecoratedText.Builder setText(String value)

Required. The primary text.

Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string text = 4;

Parameter
Name Description
value String

The text to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setTextBytes(ByteString value)

public DecoratedText.Builder setTextBytes(ByteString value)

Required. The primary text.

Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

string text = 4;

Parameter
Name Description
value ByteString

The bytes for text to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setTopLabel(String value)

public DecoratedText.Builder setTopLabel(String value)

The text that appears above text. Always truncates.

string top_label = 3;

Parameter
Name Description
value String

The topLabel to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setTopLabelBytes(ByteString value)

public DecoratedText.Builder setTopLabelBytes(ByteString value)

The text that appears above text. Always truncates.

string top_label = 3;

Parameter
Name Description
value ByteString

The bytes for topLabel to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DecoratedText.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
DecoratedText.Builder
Overrides

setWrapText(boolean value)

public DecoratedText.Builder setWrapText(boolean value)

The wrap text setting. If true, the text wraps and displays on multiple lines. Otherwise, the text is truncated.

Only applies to text, not topLabel and bottomLabel.

bool wrap_text = 5;

Parameter
Name Description
value boolean

The wrapText to set.

Returns
Type Description
DecoratedText.Builder

This builder for chaining.