Class DecoratedText (2.49.0)

public final class DecoratedText extends GeneratedMessageV3 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 Fields

BOTTOM_LABEL_FIELD_NUMBER

public static final int BOTTOM_LABEL_FIELD_NUMBER
Field Value
Type Description
int

BUTTON_FIELD_NUMBER

public static final int BUTTON_FIELD_NUMBER
Field Value
Type Description
int

END_ICON_FIELD_NUMBER

public static final int END_ICON_FIELD_NUMBER
Field Value
Type Description
int

ICON_FIELD_NUMBER

public static final int ICON_FIELD_NUMBER
Field Value
Type Description
int

ON_CLICK_FIELD_NUMBER

public static final int ON_CLICK_FIELD_NUMBER
Field Value
Type Description
int

START_ICON_FIELD_NUMBER

public static final int START_ICON_FIELD_NUMBER
Field Value
Type Description
int

SWITCH_CONTROL_FIELD_NUMBER

public static final int SWITCH_CONTROL_FIELD_NUMBER
Field Value
Type Description
int

TEXT_FIELD_NUMBER

public static final int TEXT_FIELD_NUMBER
Field Value
Type Description
int

TOP_LABEL_FIELD_NUMBER

public static final int TOP_LABEL_FIELD_NUMBER
Field Value
Type Description
int

WRAP_TEXT_FIELD_NUMBER

public static final int WRAP_TEXT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static DecoratedText getDefaultInstance()
Returns
Type Description
DecoratedText

getDescriptor()

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

newBuilder()

public static DecoratedText.Builder newBuilder()
Returns
Type Description
DecoratedText.Builder

newBuilder(DecoratedText prototype)

public static DecoratedText.Builder newBuilder(DecoratedText prototype)
Parameter
Name Description
prototype DecoratedText
Returns
Type Description
DecoratedText.Builder

parseDelimitedFrom(InputStream input)

public static DecoratedText parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static DecoratedText parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DecoratedText parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DecoratedText parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static DecoratedText parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static DecoratedText parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
DecoratedText
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<DecoratedText> parser()
Returns
Type Description
Parser<DecoratedText>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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.

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

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.

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.

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.

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

getParserForType()

public Parser<DecoratedText> getParserForType()
Returns
Type Description
Parser<DecoratedText>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DecoratedText.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
DecoratedText.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException