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

BUTTON_FIELD_NUMBER

public static final int BUTTON_FIELD_NUMBER
Field Value
TypeDescription
int

END_ICON_FIELD_NUMBER

public static final int END_ICON_FIELD_NUMBER
Field Value
TypeDescription
int

ICON_FIELD_NUMBER

public static final int ICON_FIELD_NUMBER
Field Value
TypeDescription
int

ON_CLICK_FIELD_NUMBER

public static final int ON_CLICK_FIELD_NUMBER
Field Value
TypeDescription
int

START_ICON_FIELD_NUMBER

public static final int START_ICON_FIELD_NUMBER
Field Value
TypeDescription
int

SWITCH_CONTROL_FIELD_NUMBER

public static final int SWITCH_CONTROL_FIELD_NUMBER
Field Value
TypeDescription
int

TEXT_FIELD_NUMBER

public static final int TEXT_FIELD_NUMBER
Field Value
TypeDescription
int

TOP_LABEL_FIELD_NUMBER

public static final int TOP_LABEL_FIELD_NUMBER
Field Value
TypeDescription
int

WRAP_TEXT_FIELD_NUMBER

public static final int WRAP_TEXT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static DecoratedText getDefaultInstance()
Returns
TypeDescription
DecoratedText

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static DecoratedText.Builder newBuilder()
Returns
TypeDescription
DecoratedText.Builder

newBuilder(DecoratedText prototype)

public static DecoratedText.Builder newBuilder(DecoratedText prototype)
Parameter
NameDescription
prototypeDecoratedText
Returns
TypeDescription
DecoratedText.Builder

parseDelimitedFrom(InputStream input)

public static DecoratedText parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static DecoratedText parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DecoratedText parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DecoratedText parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static DecoratedText parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static DecoratedText parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DecoratedText parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DecoratedText
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<DecoratedText> parser()
Returns
TypeDescription
Parser<DecoratedText>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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.

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

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.

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.

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.

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

getParserForType()

public Parser<DecoratedText> getParserForType()
Returns
TypeDescription
Parser<DecoratedText>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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.

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.

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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public DecoratedText.Builder newBuilderForType()
Returns
TypeDescription
DecoratedText.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DecoratedText.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
DecoratedText.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public DecoratedText.Builder toBuilder()
Returns
TypeDescription
DecoratedText.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException