Package com.google.apps.card.v1
Class Grid.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
com.google.apps.card.v1.Grid.Builder
- All Implemented Interfaces:
GridOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- Grid
public static final class Grid.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
implements GridOrBuilder
Displays a grid with a collection of items. Items can only include text or
images. For responsive columns, or to include more than text or images, use
[`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps,
see [Display a Grid with a collection of
items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items).
A grid supports any number of columns and items. The number of rows is
determined by items divided by columns. A grid with
10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns
has 6 rows.
[Google Workspace Add-ons and Chat
apps](https://developers.google.com/workspace/extend):
For example, the following JSON creates a 2 column grid with a single
item:
```
"grid": {
"title": "A fine collection of items",
"columnCount": 2,
"borderStyle": {
"type": "STROKE",
"cornerRadius": 4
},
"items": [
{
"image": {
"imageUri": "https://www.example.com/image.png",
"cropStyle": {
"type": "SQUARE"
},
"borderStyle": {
"type": "STROKE"
}
},
"title": "An item",
"textAlignment": "CENTER"
}
],
"onClick": {
"openLink": {
"url": "https://www.example.com"
}
}
}
```
Protobuf type google.apps.card.v1.Grid-
Method Summary
Modifier and TypeMethodDescriptionaddAllItems(Iterable<? extends Grid.GridItem> values) The items to display in the grid.addItems(int index, Grid.GridItem value) The items to display in the grid.addItems(int index, Grid.GridItem.Builder builderForValue) The items to display in the grid.addItems(Grid.GridItem value) The items to display in the grid.addItems(Grid.GridItem.Builder builderForValue) The items to display in the grid.The items to display in the grid.addItemsBuilder(int index) The items to display in the grid.addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()The border style to apply to each grid item.The number of columns to display in the grid.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) The items to display in the grid.This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) The text that displays in the grid header.clone()The border style to apply to each grid item.The border style to apply to each grid item.The border style to apply to each grid item.intThe number of columns to display in the grid.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetItems(int index) The items to display in the grid.getItemsBuilder(int index) The items to display in the grid.The items to display in the grid.intThe items to display in the grid.The items to display in the grid.getItemsOrBuilder(int index) The items to display in the grid.List<? extends Grid.GridItemOrBuilder>The items to display in the grid.This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.getTitle()The text that displays in the grid header.com.google.protobuf.ByteStringThe text that displays in the grid header.booleanThe border style to apply to each grid item.booleanThis callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeBorderStyle(BorderStyle value) The border style to apply to each grid item.mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeOnClick(OnClick value) This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.final Grid.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) removeItems(int index) The items to display in the grid.setBorderStyle(BorderStyle value) The border style to apply to each grid item.setBorderStyle(BorderStyle.Builder builderForValue) The border style to apply to each grid item.setColumnCount(int value) The number of columns to display in the grid.setItems(int index, Grid.GridItem value) The items to display in the grid.setItems(int index, Grid.GridItem.Builder builderForValue) The items to display in the grid.setOnClick(OnClick value) This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.setOnClick(OnClick.Builder builderForValue) This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) The text that displays in the grid header.setTitleBytes(com.google.protobuf.ByteString value) The text that displays in the grid header.final Grid.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
setField
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
setRepeatedField
public Grid.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
addRepeatedField
public Grid.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Grid.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
mergeFrom
public Grid.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Grid.Builder>- Throws:
IOException
-
getTitle
The text that displays in the grid header.
string title = 1;- Specified by:
getTitlein interfaceGridOrBuilder- Returns:
- The title.
-
getTitleBytes
public com.google.protobuf.ByteString getTitleBytes()The text that displays in the grid header.
string title = 1;- Specified by:
getTitleBytesin interfaceGridOrBuilder- Returns:
- The bytes for title.
-
setTitle
The text that displays in the grid header.
string title = 1;- Parameters:
value- The title to set.- Returns:
- This builder for chaining.
-
clearTitle
The text that displays in the grid header.
string title = 1;- Returns:
- This builder for chaining.
-
setTitleBytes
The text that displays in the grid header.
string title = 1;- Parameters:
value- The bytes for title to set.- Returns:
- This builder for chaining.
-
getItemsList
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;- Specified by:
getItemsListin interfaceGridOrBuilder
-
getItemsCount
public int getItemsCount()The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;- Specified by:
getItemsCountin interfaceGridOrBuilder
-
getItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;- Specified by:
getItemsin interfaceGridOrBuilder
-
setItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
setItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addAllItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
clearItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
removeItems
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
getItemsBuilder
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
getItemsOrBuilder
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;- Specified by:
getItemsOrBuilderin interfaceGridOrBuilder
-
getItemsOrBuilderList
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;- Specified by:
getItemsOrBuilderListin interfaceGridOrBuilder
-
addItemsBuilder
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
addItemsBuilder
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
getItemsBuilderList
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2; -
hasBorderStyle
public boolean hasBorderStyle()The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;- Specified by:
hasBorderStylein interfaceGridOrBuilder- Returns:
- Whether the borderStyle field is set.
-
getBorderStyle
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;- Specified by:
getBorderStylein interfaceGridOrBuilder- Returns:
- The borderStyle.
-
setBorderStyle
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3; -
setBorderStyle
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3; -
mergeBorderStyle
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3; -
clearBorderStyle
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3; -
getBorderStyleBuilder
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3; -
getBorderStyleOrBuilder
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;- Specified by:
getBorderStyleOrBuilderin interfaceGridOrBuilder
-
getColumnCount
public int getColumnCount()The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
int32 column_count = 4;- Specified by:
getColumnCountin interfaceGridOrBuilder- Returns:
- The columnCount.
-
setColumnCount
The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
int32 column_count = 4;- Parameters:
value- The columnCount to set.- Returns:
- This builder for chaining.
-
clearColumnCount
The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
int32 column_count = 4;- Returns:
- This builder for chaining.
-
hasOnClick
public boolean hasOnClick()This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5;- Specified by:
hasOnClickin interfaceGridOrBuilder- Returns:
- Whether the onClick field is set.
-
getOnClick
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5;- Specified by:
getOnClickin interfaceGridOrBuilder- Returns:
- The onClick.
-
setOnClick
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5; -
setOnClick
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5; -
mergeOnClick
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5; -
clearOnClick
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5; -
getOnClickBuilder
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5; -
getOnClickOrBuilder
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.
.google.apps.card.v1.OnClick on_click = 5;- Specified by:
getOnClickOrBuilderin interfaceGridOrBuilder
-
setUnknownFields
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-
mergeUnknownFields
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Grid.Builder>
-