Class DecoratedText.Builder (0.1.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 Decorated 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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public DecoratedText.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
DecoratedText.Builder
Overrides

build()

public DecoratedText build()
Returns
TypeDescription
DecoratedText

buildPartial()

public DecoratedText buildPartial()
Returns
TypeDescription
DecoratedText

clear()

public DecoratedText.Builder clear()
Returns
TypeDescription
DecoratedText.Builder
Overrides

clearBottomLabel()

public DecoratedText.Builder clearBottomLabel()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
TypeDescription
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
TypeDescription
DecoratedText.Builder

clearControl()

public DecoratedText.Builder clearControl()
Returns
TypeDescription
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
TypeDescription
DecoratedText.Builder

clearField(Descriptors.FieldDescriptor field)

public DecoratedText.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
DecoratedText.Builder
Overrides

clearIcon() (deprecated)

public DecoratedText.Builder clearIcon()

Deprecated in favor of startIcon.

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

Returns
TypeDescription
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
TypeDescription
DecoratedText.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public DecoratedText.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
DecoratedText.Builder

This builder for chaining.

clearTopLabel()

public DecoratedText.Builder clearTopLabel()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
TypeDescription
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
TypeDescription
DecoratedText.Builder

This builder for chaining.

clone()

public DecoratedText.Builder clone()
Returns
TypeDescription
DecoratedText.Builder
Overrides

getBottomLabel()

public String getBottomLabel()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
TypeDescription
String

The bottomLabel.

getBottomLabelBytes()

public ByteString getBottomLabelBytes()

The text that appears below text. Always wraps.

string bottom_label = 6;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ButtonOrBuilder

getControlCase()

public DecoratedText.ControlCase getControlCase()
Returns
TypeDescription
DecoratedText.ControlCase

getDefaultInstanceForType()

public DecoratedText getDefaultInstanceForType()
Returns
TypeDescription
DecoratedText

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
IconOrBuilder

getIcon() (deprecated)

public Icon getIcon()

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

Deprecated in favor of startIcon.

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

Returns
TypeDescription
Icon

The icon.

getIconBuilder() (deprecated)

public Icon.Builder getIconBuilder()

Deprecated in favor of startIcon.

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

Returns
TypeDescription
Icon.Builder

getIconOrBuilder() (deprecated)

public IconOrBuilder getIconOrBuilder()

Deprecated in favor of startIcon.

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

Returns
TypeDescription
IconOrBuilder

getOnClick()

public OnClick getOnClick()

This action is triggered when users click topLabel or bottomLabel.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
OnClickOrBuilder

getStartIcon()

public Icon getStartIcon()

The icon displayed in front of the text.

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

Returns
TypeDescription
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
TypeDescription
Icon.Builder

getStartIconOrBuilder()

public IconOrBuilder getStartIconOrBuilder()

The icon displayed in front of the text.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for text.

getTopLabel()

public String getTopLabel()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
TypeDescription
String

The topLabel.

getTopLabelBytes()

public ByteString getTopLabelBytes()

The text that appears above text. Always truncates.

string top_label = 3;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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=794

Deprecated in favor of startIcon.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the switchControl field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
valueButton
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
DecoratedText.Builder

mergeFrom(DecoratedText other)

public DecoratedText.Builder mergeFrom(DecoratedText other)
Parameter
NameDescription
otherDecoratedText
Returns
TypeDescription
DecoratedText.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public DecoratedText.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public DecoratedText.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
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
NameDescription
valueOnClick
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
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
NameDescription
valueDecoratedText.SwitchControl
Returns
TypeDescription
DecoratedText.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DecoratedText.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The bottomLabel to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for bottomLabel to set.

Returns
TypeDescription
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
NameDescription
valueButton
Returns
TypeDescription
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
NameDescription
builderForValueButton.Builder
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
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
NameDescription
builderForValueIcon.Builder
Returns
TypeDescription
DecoratedText.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public DecoratedText.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
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
NameDescription
builderForValueIcon.Builder
Returns
TypeDescription
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
NameDescription
valueOnClick
Returns
TypeDescription
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
NameDescription
builderForValueOnClick.Builder
Returns
TypeDescription
DecoratedText.Builder

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

public DecoratedText.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueIcon
Returns
TypeDescription
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
NameDescription
builderForValueIcon.Builder
Returns
TypeDescription
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
NameDescription
valueDecoratedText.SwitchControl
Returns
TypeDescription
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
NameDescription
builderForValueDecoratedText.SwitchControl.Builder
Returns
TypeDescription
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
NameDescription
valueString

The text to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for text to set.

Returns
TypeDescription
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
NameDescription
valueString

The topLabel to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for topLabel to set.

Returns
TypeDescription
DecoratedText.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final DecoratedText.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueboolean

The wrapText to set.

Returns
TypeDescription
DecoratedText.Builder

This builder for chaining.