Composition Objects
This page documents the public Java API for composition objects, generated from the Javadoc by the javadoc tool. Values are immutable, builders are concrete and fluent, validation runs when you call .build(), and typed getters read built values back.
AreaChart
An area chart for a data visualization block.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
-
Required:
series,axisConfig. -
Every series needs exactly one data point for each axis category.
See the Slack reference.
Builder
Starts a new builder.
public static AreaChart.Builder builder()
Returns: a new builder
Related types: AreaChart
GetSeries
Returns data series in display order. Series names must be unique.
public List<DataSeries> getSeries()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: DataSeries
GetAxisConfig
Returns the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig getAxisConfig()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: AxisConfig
Series
Adds data series in display order. Series names must be unique.
Required. Must contain between 1 and 12 items. Each call appends to any values already added.
public AreaChart.Builder series(DataSeries... values)
| Parameter | Description |
|---|---|
values | DataSeries values appended in order |
Returns: this builder
Related types: AreaChart, DataSeries
AxisConfig
Sets the axis categories and labels. Every series needs exactly one point per category.
Required.
public AreaChart.Builder axisConfig(AxisConfig value)
| Parameter | Description |
|---|---|
value | nested AxisConfig |
Returns: this builder
Related types: AreaChart, AxisConfig
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public AreaChart.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: AreaChart
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public AreaChart build()
Returns: an immutable AreaChart
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: AreaChart
AxisConfig
The categories and labels shared by bar, area, and line chart axes.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
categories.
See the Slack reference.
Builder
Starts a new builder.
public static AxisConfig.Builder builder()
Returns: a new builder
Related types: AxisConfig
GetCategories
Returns axis categories in display order. Labels must be unique.
public List<String> getCategories()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetXLabel
Returns the horizontal axis label.
public Optional<String> getXLabel()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetYLabel
Returns the vertical axis label.
public Optional<String> getYLabel()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Categories
Adds axis categories in display order. Labels must be unique.
Required. Must contain between 1 and 20 items. Each call appends to any values already added.
public AxisConfig.Builder categories(String... values)
| Parameter | Description |
|---|---|
values | values appended in order |
Returns: this builder
Related types: AxisConfig
XLabel
Sets the horizontal axis label.
Slack allows at most 50 characters.
public AxisConfig.Builder xLabel(String value)
| Parameter | Description |
|---|---|
value | value for Slack's x_label field |
Returns: this builder
Related types: AxisConfig
YLabel
Sets the vertical axis label.
Slack allows at most 50 characters.
public AxisConfig.Builder yLabel(String value)
| Parameter | Description |
|---|---|
value | value for Slack's y_label field |
Returns: this builder
Related types: AxisConfig
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public AxisConfig.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: AxisConfig
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public AxisConfig build()
Returns: an immutable AxisConfig
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: AxisConfig
BarChart
A bar chart for a data visualization block.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
-
Required:
series,axisConfig. -
Every series needs exactly one data point for each axis category.
See the Slack reference.
Builder
Starts a new builder.
public static BarChart.Builder builder()
Returns: a new builder
Related types: BarChart
GetSeries
Returns data series in display order. Series names must be unique.
public List<DataSeries> getSeries()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: DataSeries
GetAxisConfig
Returns the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig getAxisConfig()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: AxisConfig
Series
Adds data series in display order. Series names must be unique.
Required. Must contain between 1 and 12 items. Each call appends to any values already added.
public BarChart.Builder series(DataSeries... values)
| Parameter | Description |
|---|---|
values | DataSeries values appended in order |
Returns: this builder
Related types: BarChart, DataSeries
AxisConfig
Sets the axis categories and labels. Every series needs exactly one point per category.
Required.
public BarChart.Builder axisConfig(AxisConfig value)
| Parameter | Description |
|---|---|
value | nested AxisConfig |
Returns: this builder
Related types: AxisConfig, BarChart
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public BarChart.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: BarChart
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public BarChart build()
Returns: an immutable BarChart
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: BarChart
Chart
A chart that can be displayed by a data visualization block.
Implemented by AreaChart, BarChart, LineChart, PieChart.
ChartSegment
One labelled segment of a pie chart.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
label,value.
See the Slack reference.
Builder
Starts a new builder.
public static ChartSegment.Builder builder()
Returns: a new builder
Related types: ChartSegment
GetLabel
Returns the segment label.
public String getLabel()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetValue
Returns the segment's size. Must be greater than zero.
public Number getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Label
Sets the segment label.
Required. Slack allows at most 20 characters.
public ChartSegment.Builder label(String value)
| Parameter | Description |
|---|---|
value | value for Slack's label field |
Returns: this builder
Related types: ChartSegment
Value — long
Sets the segment's size. Must be greater than zero.
Required. Whole numbers are sent without a decimal point.
public ChartSegment.Builder value(long value)
| Parameter | Description |
|---|---|
value | whole-number value |
Returns: this builder
Related types: ChartSegment
Value — double
Sets the segment's size. Must be greater than zero.
Required. Prefer value(long) for whole numbers.
public ChartSegment.Builder value(double value)
| Parameter | Description |
|---|---|
value | decimal value |
Returns: this builder
Related types: ChartSegment
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public ChartSegment.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: ChartSegment
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public ChartSegment build()
Returns: an immutable ChartSegment
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: ChartSegment
ColumnAlign
Horizontal alignment for table columns.
| Constant | Slack value | Meaning |
|---|---|---|
LEFT | left | Align cell content to the left. |
CENTER | center | Center cell content. |
RIGHT | right | Align cell content to the right. |
WireValue
Returns the value Slack expects in JSON.
public String wireValue()
Returns: the wire value
FromWireValue
Finds the constant for a Slack JSON value.
public static Optional<ColumnAlign> fromWireValue(String wireValue)
| Parameter | Description |
|---|---|
wireValue | the value Slack uses in JSON |
Returns: the matching constant, or an empty optional for an unknown value
Related types: ColumnAlign
ColumnSettings
Alignment and wrapping settings for one table column.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
See the Slack reference.
Builder
Starts a new builder.
public static ColumnSettings.Builder builder()
Returns: a new builder
Related types: ColumnSettings
GetAlign
Returns how cell content in the column is aligned.
public Optional<ColumnAlign> getAlign()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: ColumnAlign
GetWrapped
Returns whether long cell content wraps instead of being truncated.
public Optional<Boolean> getWrapped()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Align
Sets how cell content in the column is aligned.
public ColumnSettings.Builder align(ColumnAlign value)
| Parameter | Description |
|---|---|
value | value for Slack's align field |
Returns: this builder
Related types: ColumnAlign, ColumnSettings
IsWrapped
Sets whether long cell content wraps instead of being truncated.
public ColumnSettings.Builder isWrapped(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's is_wrapped field |
Returns: this builder
Related types: ColumnSettings
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public ColumnSettings.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: ColumnSettings
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public ColumnSettings build()
Returns: an immutable ColumnSettings
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: ColumnSettings
Confirmation
A dialog that asks users to confirm an action before it is sent.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
title,text,confirm,deny.
See the Slack reference.
Builder
Starts a new builder.
public static Confirmation.Builder builder()
Returns: a new builder
Related types: Confirmation
GetTitle
Returns the dialog title.
public PlainText getTitle()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: PlainText
GetText
Returns the explanatory text in the dialog body.
public Text getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: Text
GetConfirm
Returns the label of the button that confirms the action.
public PlainText getConfirm()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: PlainText
GetDeny
Returns the label of the button that cancels the action.
public PlainText getDeny()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: PlainText
GetStyle
Returns the emphasis of the confirm button.
public Optional<ButtonStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: ButtonStyle
Title — String
Sets the dialog title.
Required. Slack allows at most 100 characters. The string is sent as a plain_text text object.
public Confirmation.Builder title(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Confirmation
Title — PlainText
Sets the dialog title.
Required. Slack allows at most 100 characters.
public Confirmation.Builder title(PlainText value)
| Parameter | Description |
|---|---|
value | a PlainText object |
Returns: this builder
Related types: Confirmation, PlainText
Text — String
Sets the explanatory text in the dialog body.
Required. Slack allows at most 300 characters. The string is sent as a mrkdwn text object.
public Confirmation.Builder text(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Confirmation
Text — Text
Sets the explanatory text in the dialog body.
Required. Slack allows at most 300 characters.
public Confirmation.Builder text(Text value)
| Parameter | Description |
|---|---|
value | a Text object |
Returns: this builder
Related types: Confirmation, Text
MarkdownText
Sets the explanatory text in the dialog body.
Required. Slack allows at most 300 characters. Equivalent to text(String).
public Confirmation.Builder markdownText(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Confirmation
Confirm — String
Sets the label of the button that confirms the action.
Required. Slack allows at most 30 characters. The string is sent as a plain_text text object.
public Confirmation.Builder confirm(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Confirmation
Confirm — PlainText
Sets the label of the button that confirms the action.
Required. Slack allows at most 30 characters.
public Confirmation.Builder confirm(PlainText value)
| Parameter | Description |
|---|---|
value | a PlainText object |
Returns: this builder
Related types: Confirmation, PlainText
Deny — String
Sets the label of the button that cancels the action.
Required. Slack allows at most 30 characters. The string is sent as a plain_text text object.
public Confirmation.Builder deny(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Confirmation
Deny — PlainText
Sets the label of the button that cancels the action.
Required. Slack allows at most 30 characters.
public Confirmation.Builder deny(PlainText value)
| Parameter | Description |
|---|---|
value | a PlainText object |
Returns: this builder
Related types: Confirmation, PlainText
Style
Sets the emphasis of the confirm button.
public Confirmation.Builder style(ButtonStyle value)
| Parameter | Description |
|---|---|
value | value for Slack's style field |
Returns: this builder
Related types: ButtonStyle, Confirmation
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public Confirmation.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: Confirmation
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public Confirmation build()
Returns: an immutable Confirmation
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: Confirmation
ConversationFilter
Limits which conversations a conversation menu offers.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Set at least one filter.
See the Slack reference.
Builder
Starts a new builder.
public static ConversationFilter.Builder builder()
Returns: a new builder
Related types: ConversationFilter
GetInclude
Returns conversation types to offer: im, mpim, private, or public.
public List<String> getInclude()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetExcludeExternalSharedChannels
Returns whether externally shared channels are excluded.
public Optional<Boolean> getExcludeExternalSharedChannels()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetExcludeBotUsers
Returns whether bot users are excluded.
public Optional<Boolean> getExcludeBotUsers()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Include
Adds conversation types to offer: im, mpim, private, or public.
Each call appends to any values already added.
public ConversationFilter.Builder include(String... values)
| Parameter | Description |
|---|---|
values | values appended in order |
Returns: this builder
Related types: ConversationFilter
ExcludeExternalSharedChannels
Sets whether externally shared channels are excluded.
public ConversationFilter.Builder excludeExternalSharedChannels(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's exclude_external_shared_channels field |
Returns: this builder
Related types: ConversationFilter
ExcludeBotUsers
Sets whether bot users are excluded.
public ConversationFilter.Builder excludeBotUsers(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's exclude_bot_users field |
Returns: this builder
Related types: ConversationFilter
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public ConversationFilter.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: ConversationFilter
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public ConversationFilter build()
Returns: an immutable ConversationFilter
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: ConversationFilter
DataPoint
One value of a chart series, keyed by axis category.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
label,value.
See the Slack reference.
Builder
Starts a new builder.
public static DataPoint.Builder builder()
Returns: a new builder
Related types: DataPoint
GetLabel
Returns the axis category this point belongs to.
public String getLabel()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetValue
Returns the point's value.
public Number getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Label
Sets the axis category this point belongs to.
Required. Slack allows at most 20 characters.
public DataPoint.Builder label(String value)
| Parameter | Description |
|---|---|
value | value for Slack's label field |
Returns: this builder
Related types: DataPoint
Value — long
Sets the point's value.
Required. Whole numbers are sent without a decimal point.
public DataPoint.Builder value(long value)
| Parameter | Description |
|---|---|
value | whole-number value |
Returns: this builder
Related types: DataPoint
Value — double
Sets the point's value.
Required. Prefer value(long) for whole numbers.
public DataPoint.Builder value(double value)
| Parameter | Description |
|---|---|
value | decimal value |
Returns: this builder
Related types: DataPoint
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public DataPoint.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: DataPoint
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public DataPoint build()
Returns: an immutable DataPoint
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: DataPoint
DataSeries
A named series of chart data points.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
name,data.
See the Slack reference.
Builder
Starts a new builder.
public static DataSeries.Builder builder()
Returns: a new builder
Related types: DataSeries
GetName
Returns the series name shown in the legend.
public String getName()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetData
Returns data points in axis-category order.
public List<DataPoint> getData()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: DataPoint
Name
Sets the series name shown in the legend.
Required. Slack allows at most 20 characters.
public DataSeries.Builder name(String value)
| Parameter | Description |
|---|---|
value | value for Slack's name field |
Returns: this builder
Related types: DataSeries
Data
Adds data points in axis-category order.
Required. Must contain between 1 and 20 items. Each call appends to any values already added.
public DataSeries.Builder data(DataPoint... values)
| Parameter | Description |
|---|---|
values | DataPoint values appended in order |
Returns: this builder
Related types: DataPoint, DataSeries
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public DataSeries.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: DataSeries
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public DataSeries build()
Returns: an immutable DataSeries
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: DataSeries
DispatchActionConfiguration
Chooses which interactions with an input send a block_actions payload.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
See the Slack reference.
Builder
Starts a new builder.
public static DispatchActionConfiguration.Builder builder()
Returns: a new builder
Related types: DispatchActionConfiguration
GetTriggerActionsOn
Returns the interactions that send a payload: on_enter_pressed or on_character_entered.
public List<String> getTriggerActionsOn()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
TriggerActionsOn
Adds the interactions that send a payload: on_enter_pressed or on_character_entered.
Each call appends to any values already added.
public DispatchActionConfiguration.Builder triggerActionsOn(String... values)
| Parameter | Description |
|---|---|
values | values appended in order |
Returns: this builder
Related types: DispatchActionConfiguration
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public DispatchActionConfiguration.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: DispatchActionConfiguration
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public DispatchActionConfiguration build()
Returns: an immutable DispatchActionConfiguration
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: DispatchActionConfiguration
FeedbackButton
One button of a feedback buttons element.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text,value.
See the Slack reference.
Builder
Starts a new builder.
public static FeedbackButton.Builder builder()
Returns: a new builder
Related types: FeedbackButton
GetText
Returns the button label.
public PlainText getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: PlainText
GetValue
Returns the application-defined value sent in interaction payloads.
public String getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetAccessibilityLabel
Returns the label read by screen readers in place of the visible text.
public Optional<String> getAccessibilityLabel()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Text — String
Sets the button label.
Required. Slack allows at most 75 characters. The string is sent as a plain_text text object.
public FeedbackButton.Builder text(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: FeedbackButton
Text — PlainText
Sets the button label.
Required. Slack allows at most 75 characters.
public FeedbackButton.Builder text(PlainText value)
| Parameter | Description |
|---|---|
value | a PlainText object |
Returns: this builder
Related types: FeedbackButton, PlainText
PlainText
Sets the button label.
Required. Slack allows at most 75 characters. Equivalent to text(String).
public FeedbackButton.Builder plainText(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: FeedbackButton
Value
Sets the application-defined value sent in interaction payloads.
Required. Slack allows at most 2000 characters.
public FeedbackButton.Builder value(String value)
| Parameter | Description |
|---|---|
value | value for Slack's value field |
Returns: this builder
Related types: FeedbackButton
AccessibilityLabel
Sets the label read by screen readers in place of the visible text.
Slack allows at most 75 characters.
public FeedbackButton.Builder accessibilityLabel(String value)
| Parameter | Description |
|---|---|
value | value for Slack's accessibility_label field |
Returns: this builder
Related types: FeedbackButton
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public FeedbackButton.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: FeedbackButton
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public FeedbackButton build()
Returns: an immutable FeedbackButton
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: FeedbackButton
InputParameter
A named value passed to a workflow trigger.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
name,value.
See the Slack reference.
Builder
Starts a new builder.
public static InputParameter.Builder builder()
Returns: a new builder
Related types: InputParameter
GetName
Returns the workflow input parameter name.
public String getName()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetValue
Returns the value passed to the workflow input.
public String getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Name
Sets the workflow input parameter name.
Required.
public InputParameter.Builder name(String value)
| Parameter | Description |
|---|---|
value | value for Slack's name field |
Returns: this builder
Related types: InputParameter
Value
Sets the value passed to the workflow input.
Required.
public InputParameter.Builder value(String value)
| Parameter | Description |
|---|---|
value | value for Slack's value field |
Returns: this builder
Related types: InputParameter
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public InputParameter.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: InputParameter
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public InputParameter build()
Returns: an immutable InputParameter
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: InputParameter
LineChart
A line chart for a data visualization block.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
-
Required:
series,axisConfig. -
Every series needs exactly one data point for each axis category.
See the Slack reference.
Builder
Starts a new builder.
public static LineChart.Builder builder()
Returns: a new builder
Related types: LineChart
GetSeries
Returns data series in display order. Series names must be unique.
public List<DataSeries> getSeries()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: DataSeries
GetAxisConfig
Returns the axis categories and labels. Every series needs exactly one point per category.
public AxisConfig getAxisConfig()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: AxisConfig
Series
Adds data series in display order. Series names must be unique.
Required. Must contain between 1 and 12 items. Each call appends to any values already added.
public LineChart.Builder series(DataSeries... values)
| Parameter | Description |
|---|---|
values | DataSeries values appended in order |
Returns: this builder
Related types: DataSeries, LineChart
AxisConfig
Sets the axis categories and labels. Every series needs exactly one point per category.
Required.
public LineChart.Builder axisConfig(AxisConfig value)
| Parameter | Description |
|---|---|
value | nested AxisConfig |
Returns: this builder
Related types: AxisConfig, LineChart
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public LineChart.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: LineChart
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public LineChart build()
Returns: an immutable LineChart
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: LineChart
MarkdownText
A mrkdwn text composition object.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text.
See the Slack reference.
Builder
Starts a new builder.
public static MarkdownText.Builder builder()
Returns: a new builder
Related types: MarkdownText
Of
Creates and validates mrkdwn text in one call.
public static MarkdownText of(String text)
| Parameter | Description |
|---|---|
text | mrkdwn content |
Returns: an immutable MarkdownText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule |
Related types: MarkdownText
GetVerbatim
Returns whether Slack leaves URLs, mentions, and channel names unlinked.
public Optional<Boolean> getVerbatim()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetType
Returns the Slack text representation type.
public String getType()
Returns: Slack wire type
GetText
Returns the text content.
public String getText()
Returns: text content
Text
Sets the mrkdwn-formatted text content.
Required.
public MarkdownText.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: MarkdownText
Verbatim
Sets whether Slack leaves URLs, mentions, and channel names unlinked.
public MarkdownText.Builder verbatim(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's verbatim field |
Returns: this builder
Related types: MarkdownText
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public MarkdownText.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: MarkdownText
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public MarkdownText build()
Returns: an immutable MarkdownText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: MarkdownText
Option
A selectable option for menus, checkboxes, radio buttons, and overflow menus.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text,value.
See the Slack reference.
Builder — no arguments
Starts a new builder.
public static Option.Builder builder()
Returns: a new builder
Related types: Option
Builder — String, String
Starts an option builder with its required label and value.
public static Option.Builder builder(String text, String value)
| Parameter | Description |
|---|---|
text | visible option label |
value | application-defined value |
Returns: a new builder
Related types: Option
GetText
Returns the option label shown to users.
public Text getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: Text
GetValue
Returns the value sent in interaction payloads when this option is chosen.
public String getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetDescription
Returns supporting text shown below the label. Only rendered by checkboxes and radio buttons.
public Optional<Text> getDescription()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: Text
GetUrl
Returns a URL loaded in the user's browser when an overflow menu option is chosen.
public Optional<String> getUrl()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Text — String
Sets the option label shown to users.
Required. Slack allows at most 75 characters. The string is sent as a plain_text text object.
public Option.Builder text(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Option
Text — Text
Sets the option label shown to users.
Required. Slack allows at most 75 characters.
public Option.Builder text(Text value)
| Parameter | Description |
|---|---|
value | a Text object |
Returns: this builder
PlainText
Sets the option label shown to users.
Required. Slack allows at most 75 characters. Equivalent to text(String).
public Option.Builder plainText(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Option
Value
Sets the value sent in interaction payloads when this option is chosen.
Required. Slack allows at most 150 characters.
public Option.Builder value(String value)
| Parameter | Description |
|---|---|
value | value for Slack's value field |
Returns: this builder
Related types: Option
Description — String
Sets supporting text shown below the label. Only rendered by checkboxes and radio buttons.
Slack allows at most 75 characters. The string is sent as a plain_text text object.
public Option.Builder description(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: Option
Description — Text
Sets supporting text shown below the label. Only rendered by checkboxes and radio buttons.
Slack allows at most 75 characters.
public Option.Builder description(Text value)
| Parameter | Description |
|---|---|
value | a Text object |
Returns: this builder
Url
Sets a URL loaded in the user's browser when an overflow menu option is chosen.
Slack allows at most 3000 characters.
public Option.Builder url(String value)
| Parameter | Description |
|---|---|
value | value for Slack's url field |
Returns: this builder
Related types: Option
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public Option.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: Option
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public Option build()
Returns: an immutable Option
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: Option
OptionGroup
A labelled group of options in a static select menu.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
label,options.
See the Slack reference.
Builder
Starts a new builder.
public static OptionGroup.Builder builder()
Returns: a new builder
Related types: OptionGroup
GetLabel
Returns the group heading.
public PlainText getLabel()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: PlainText
GetOptions
Returns selectable options in display order.
public List<Option> getOptions()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: Option
Label — String
Sets the group heading.
Required. Slack allows at most 75 characters. The string is sent as a plain_text text object.
public OptionGroup.Builder label(String value)
| Parameter | Description |
|---|---|
value | text content |
Returns: this builder
Related types: OptionGroup
Label — PlainText
Sets the group heading.
Required. Slack allows at most 75 characters.
public OptionGroup.Builder label(PlainText value)
| Parameter | Description |
|---|---|
value | a PlainText object |
Returns: this builder
Related types: OptionGroup, PlainText
Options
Adds selectable options in display order.
Required. Must contain between 1 and 100 items. Each call appends to any values already added.
public OptionGroup.Builder options(Option... values)
| Parameter | Description |
|---|---|
values | Option values appended in order |
Returns: this builder
Related types: Option, OptionGroup
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public OptionGroup.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: OptionGroup
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public OptionGroup build()
Returns: an immutable OptionGroup
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: OptionGroup
PieChart
A pie chart for a data visualization block.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
segments.
See the Slack reference.
Builder
Starts a new builder.
public static PieChart.Builder builder()
Returns: a new builder
Related types: PieChart
GetSegments
Returns pie segments in display order.
public List<ChartSegment> getSegments()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: ChartSegment
Segments
Adds pie segments in display order.
Required. Must contain between 1 and 12 items. Each call appends to any values already added.
public PieChart.Builder segments(ChartSegment... values)
| Parameter | Description |
|---|---|
values | ChartSegment values appended in order |
Returns: this builder
Related types: ChartSegment, PieChart
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public PieChart.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: PieChart
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public PieChart build()
Returns: an immutable PieChart
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: PieChart
PlainText
A plain-text composition object.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text.
See the Slack reference.
Builder
Starts a new builder.
public static PlainText.Builder builder()
Returns: a new builder
Related types: PlainText
Of
Creates and validates plain text in one call.
public static PlainText of(String text)
| Parameter | Description |
|---|---|
text | text content |
Returns: an immutable PlainText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule |
Related types: PlainText
GetEmoji
Returns whether emoji shortcodes such as 🎉 are rendered as emoji.
public Optional<Boolean> getEmoji()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetType
Returns the Slack text representation type.
public String getType()
Returns: Slack wire type
GetText
Returns the text content.
public String getText()
Returns: text content
Text
Sets the text content.
Required.
public PlainText.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: PlainText
Emoji
Sets whether emoji shortcodes such as 🎉 are rendered as emoji.
public PlainText.Builder emoji(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's emoji field |
Returns: this builder
Related types: PlainText
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public PlainText.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: PlainText
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public PlainText build()
Returns: an immutable PlainText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: PlainText
RawNumber
A numeric data table cell with display text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
value,text.
See the Slack reference.
Builder
Starts a new builder.
public static RawNumber.Builder builder()
Returns: a new builder
Related types: RawNumber
GetValue
Returns the numeric value used for sorting.
public Number getValue()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetText
Returns the formatted text displayed for the number, such as 1,234.5.
public String getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Value — long
Sets the numeric value used for sorting.
Required. Whole numbers are sent without a decimal point.
public RawNumber.Builder value(long value)
| Parameter | Description |
|---|---|
value | whole-number value |
Returns: this builder
Related types: RawNumber
Value — double
Sets the numeric value used for sorting.
Required. Prefer value(long) for whole numbers.
public RawNumber.Builder value(double value)
| Parameter | Description |
|---|---|
value | decimal value |
Returns: this builder
Related types: RawNumber
Text
Sets the formatted text displayed for the number, such as 1,234.5.
Required.
public RawNumber.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: RawNumber
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RawNumber.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RawNumber
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RawNumber build()
Returns: an immutable RawNumber
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RawNumber
RawText
An unformatted table cell.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text.
See the Slack reference.
Builder
Starts a new builder.
public static RawText.Builder builder()
Returns: a new builder
Related types: RawText
Of
Creates and validates a raw text cell in one call.
public static RawText of(String text)
| Parameter | Description |
|---|---|
text | cell text |
Returns: an immutable RawText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule |
Related types: RawText
GetText
Returns the cell text.
public String getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Text
Sets the cell text.
Required.
public RawText.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: RawText
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RawText.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RawText
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RawText build()
Returns: an immutable RawText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RawText
RichTextBlockElement
A top-level element of a rich text block: a section, list, preformatted block, or quote.
Implemented by RichTextCodeBlock, RichTextList, RichTextQuote, RichTextSection.
RichTextChannel
A channel mention inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
channelId.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextChannel.Builder builder()
Returns: a new builder
Related types: RichTextChannel
GetChannelId
Returns the ID of the mentioned channel.
public String getChannelId()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetStyle
Returns the mention style.
public Optional<RichTextStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextStyle
ChannelId
Sets the ID of the mentioned channel.
Required.
public RichTextChannel.Builder channelId(String value)
| Parameter | Description |
|---|---|
value | value for Slack's channel_id field |
Returns: this builder
Related types: RichTextChannel
Style
Sets the mention style.
Replaces any style flags already set.
public RichTextChannel.Builder style(RichTextStyle value)
| Parameter | Description |
|---|---|
value | the complete text style |
Returns: this builder
Related types: RichTextChannel, RichTextStyle
Bold
Sets whether the bold style is applied.
public RichTextChannel.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
Italic
Sets whether the italic style is applied.
public RichTextChannel.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
Strike
Sets whether the strike style is applied.
public RichTextChannel.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
Highlight
Sets whether the highlight style is applied.
public RichTextChannel.Builder highlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
ClientHighlight
Sets whether the client_highlight style is applied.
public RichTextChannel.Builder clientHighlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
Unlink
Sets whether the unlink style is applied.
public RichTextChannel.Builder unlink(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextChannel
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextChannel.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextChannel
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextChannel build()
Returns: an immutable RichTextChannel
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextChannel
RichTextCodeBlock
A preformatted code block inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
elements.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextCodeBlock.Builder builder()
Returns: a new builder
Related types: RichTextCodeBlock
GetElements
Returns inline rich text elements in display order.
public List<RichTextSectionElement> getElements()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextSectionElement
GetBorder
Returns the width of the left border, in pixels.
public OptionalInt getBorder()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Elements
Adds inline rich text elements in display order.
Required. Each call appends to any values already added.
public RichTextCodeBlock.Builder elements(RichTextSectionElement... values)
| Parameter | Description |
|---|---|
values | RichTextSectionElement values appended in order |
Returns: this builder
Related types: RichTextCodeBlock, RichTextSectionElement
Border
Sets the width of the left border, in pixels.
public RichTextCodeBlock.Builder border(int value)
| Parameter | Description |
|---|---|
value | value for Slack's border field |
Returns: this builder
Related types: RichTextCodeBlock
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextCodeBlock.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextCodeBlock
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextCodeBlock build()
Returns: an immutable RichTextCodeBlock
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextCodeBlock
RichTextEmoji
An emoji inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
name.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextEmoji.Builder builder()
Returns: a new builder
Related types: RichTextEmoji
GetName
Returns the emoji shortcode name, without colons.
public String getName()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetSkinTone
Returns the emoji skin tone, from 1 to 6.
public OptionalInt getSkinTone()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Name
Sets the emoji shortcode name, without colons.
Required.
public RichTextEmoji.Builder name(String value)
| Parameter | Description |
|---|---|
value | value for Slack's name field |
Returns: this builder
Related types: RichTextEmoji
SkinTone
Sets the emoji skin tone, from 1 to 6.
public RichTextEmoji.Builder skinTone(int value)
| Parameter | Description |
|---|---|
value | value for Slack's skin_tone field |
Returns: this builder
Related types: RichTextEmoji
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextEmoji.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextEmoji
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextEmoji build()
Returns: an immutable RichTextEmoji
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextEmoji
RichTextLink
A hyperlink inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
url.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextLink.Builder builder()
Returns: a new builder
Related types: RichTextLink
GetUrl
Returns the link target.
public String getUrl()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetText
Returns the visible link text. Slack shows the URL when omitted.
public Optional<String> getText()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetStyle
Returns the visual style.
public Optional<RichTextStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextStyle
GetUnsafe
Returns whether Slack treats the link as unsafe.
public Optional<Boolean> getUnsafe()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Url
Sets the link target.
Required.
public RichTextLink.Builder url(String value)
| Parameter | Description |
|---|---|
value | value for Slack's url field |
Returns: this builder
Related types: RichTextLink
Text
Sets the visible link text. Slack shows the URL when omitted.
public RichTextLink.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: RichTextLink
Style
Sets the visual style.
Replaces any style flags already set.
public RichTextLink.Builder style(RichTextStyle value)
| Parameter | Description |
|---|---|
value | the complete text style |
Returns: this builder
Related types: RichTextLink, RichTextStyle
Bold
Sets whether the bold style is applied.
public RichTextLink.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextLink
Italic
Sets whether the italic style is applied.
public RichTextLink.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextLink
Strike
Sets whether the strike style is applied.
public RichTextLink.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextLink
Code
Sets whether the code style is applied.
public RichTextLink.Builder code(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextLink
Unsafe
Sets whether Slack treats the link as unsafe.
public RichTextLink.Builder unsafe(boolean value)
| Parameter | Description |
|---|---|
value | value for Slack's unsafe field |
Returns: this builder
Related types: RichTextLink
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextLink.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextLink
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextLink build()
Returns: an immutable RichTextLink
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextLink
RichTextList
A bulleted or numbered list inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
style,elements.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextList.Builder builder()
Returns: a new builder
Related types: RichTextList
GetStyle
Returns whether the list is bulleted or numbered.
public RichTextListStyle getStyle()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextListStyle
GetElements
Returns list items, one rich text section per item.
public List<RichTextSection> getElements()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextSection
GetIndent
Returns the list's indentation level.
public OptionalInt getIndent()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetOffset
Returns the number of items to skip when numbering an ordered list.
public OptionalInt getOffset()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetBorder
Returns the width of the left border, in pixels.
public OptionalInt getBorder()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Style
Sets whether the list is bulleted or numbered.
Required.
public RichTextList.Builder style(RichTextListStyle value)
| Parameter | Description |
|---|---|
value | value for Slack's style field |
Returns: this builder
Related types: RichTextList, RichTextListStyle
Elements
Adds list items, one rich text section per item.
Required. Each call appends to any values already added.
public RichTextList.Builder elements(RichTextSection... values)
| Parameter | Description |
|---|---|
values | RichTextSection values appended in order |
Returns: this builder
Related types: RichTextList, RichTextSection
Indent
Sets the list's indentation level.
public RichTextList.Builder indent(int value)
| Parameter | Description |
|---|---|
value | value for Slack's indent field |
Returns: this builder
Related types: RichTextList
Offset
Sets the number of items to skip when numbering an ordered list.
public RichTextList.Builder offset(int value)
| Parameter | Description |
|---|---|
value | value for Slack's offset field |
Returns: this builder
Related types: RichTextList
Border
Sets the width of the left border, in pixels.
public RichTextList.Builder border(int value)
| Parameter | Description |
|---|---|
value | value for Slack's border field |
Returns: this builder
Related types: RichTextList
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextList.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextList
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextList build()
Returns: an immutable RichTextList
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextList
RichTextListStyle
Marker styles for rich text lists.
| Constant | Slack value | Meaning |
|---|---|---|
BULLET | bullet | An unordered, bulleted list. |
ORDERED | ordered | A numbered list. |
WireValue
Returns the value Slack expects in JSON.
public String wireValue()
Returns: the wire value
FromWireValue
Finds the constant for a Slack JSON value.
public static Optional<RichTextListStyle> fromWireValue(String wireValue)
| Parameter | Description |
|---|---|
wireValue | the value Slack uses in JSON |
Returns: the matching constant, or an empty optional for an unknown value
Related types: RichTextListStyle
RichTextQuote
A quotation inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
elements.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextQuote.Builder builder()
Returns: a new builder
Related types: RichTextQuote
GetElements
Returns inline rich text elements in display order.
public List<RichTextSectionElement> getElements()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextSectionElement
GetBorder
Returns the width of the left border, in pixels.
public OptionalInt getBorder()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Elements
Adds inline rich text elements in display order.
Required. Each call appends to any values already added.
public RichTextQuote.Builder elements(RichTextSectionElement... values)
| Parameter | Description |
|---|---|
values | RichTextSectionElement values appended in order |
Returns: this builder
Related types: RichTextQuote, RichTextSectionElement
Border
Sets the width of the left border, in pixels.
public RichTextQuote.Builder border(int value)
| Parameter | Description |
|---|---|
value | value for Slack's border field |
Returns: this builder
Related types: RichTextQuote
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextQuote.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextQuote
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextQuote build()
Returns: an immutable RichTextQuote
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextQuote
RichTextSection
A paragraph of inline rich text elements.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
elements.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextSection.Builder builder()
Returns: a new builder
Related types: RichTextSection
GetElements
Returns inline rich text elements in display order.
public List<RichTextSectionElement> getElements()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextSectionElement
Elements
Adds inline rich text elements in display order.
Required. Each call appends to any values already added.
public RichTextSection.Builder elements(RichTextSectionElement... values)
| Parameter | Description |
|---|---|
values | RichTextSectionElement values appended in order |
Returns: this builder
Related types: RichTextSection, RichTextSectionElement
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextSection.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextSection
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextSection build()
Returns: an immutable RichTextSection
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextSection
RichTextSectionElement
An inline rich text element: text, a link, an emoji, or a channel, user, or user group mention.
Implemented by RichTextChannel, RichTextEmoji, RichTextLink, RichTextText, RichTextUser, RichTextUserGroup.
RichTextStyle
Formatting flags for inline rich text elements, reusable across elements.
Text and links support bold, italic, strike, and code. Channel, user, and user group mentions support bold, italic, strike, highlight, client highlight, and unlink. Each rich text builder also offers the individual flag methods it supports.
RichTextStyle emphasis = RichTextStyle.builder().bold(true).italic(true).build();
RichTextText.builder().text("Deploy now").style(emphasis).build();
See the Slack reference.
Builder
Starts a new builder.
public static RichTextStyle.Builder builder()
Returns: a new builder
Related types: RichTextStyle
Bold
Sets whether text is bold.
public RichTextStyle.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Italic
Sets whether text is italic.
public RichTextStyle.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Strike
Sets whether text is struck through.
public RichTextStyle.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Code
Sets whether text or a link is shown as inline code.
public RichTextStyle.Builder code(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Highlight
Sets whether a mention is highlighted.
public RichTextStyle.Builder highlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
ClientHighlight
Sets whether a mention uses the client's highlight color.
public RichTextStyle.Builder clientHighlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Unlink
Sets whether a mention is shown without a link.
public RichTextStyle.Builder unlink(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextStyle
Build
Creates an immutable style. A style with no flags serializes as an empty object.
public RichTextStyle build()
Returns: an immutable style
Related types: RichTextStyle
RichTextText
A run of optionally styled text inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
text.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextText.Builder builder()
Returns: a new builder
Related types: RichTextText
GetText
Returns the text content.
public String getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetStyle
Returns the visual style.
public Optional<RichTextStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextStyle
Text
Sets the text content.
Required.
public RichTextText.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: RichTextText
Style
Sets the visual style.
Replaces any style flags already set.
public RichTextText.Builder style(RichTextStyle value)
| Parameter | Description |
|---|---|
value | the complete text style |
Returns: this builder
Related types: RichTextStyle, RichTextText
Bold
Sets whether the bold style is applied.
public RichTextText.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextText
Italic
Sets whether the italic style is applied.
public RichTextText.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextText
Strike
Sets whether the strike style is applied.
public RichTextText.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextText
Code
Sets whether the code style is applied.
public RichTextText.Builder code(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextText
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextText.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextText
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextText build()
Returns: an immutable RichTextText
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextText
RichTextUser
A user mention inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
userId.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextUser.Builder builder()
Returns: a new builder
Related types: RichTextUser
GetUserId
Returns the ID of the mentioned user.
public String getUserId()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetStyle
Returns the visual style.
public Optional<RichTextStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextStyle
UserId
Sets the ID of the mentioned user.
Required.
public RichTextUser.Builder userId(String value)
| Parameter | Description |
|---|---|
value | value for Slack's user_id field |
Returns: this builder
Related types: RichTextUser
Style
Sets the visual style.
Replaces any style flags already set.
public RichTextUser.Builder style(RichTextStyle value)
| Parameter | Description |
|---|---|
value | the complete text style |
Returns: this builder
Related types: RichTextStyle, RichTextUser
Bold
Sets whether the bold style is applied.
public RichTextUser.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
Italic
Sets whether the italic style is applied.
public RichTextUser.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
Strike
Sets whether the strike style is applied.
public RichTextUser.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
Highlight
Sets whether the highlight style is applied.
public RichTextUser.Builder highlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
ClientHighlight
Sets whether the client_highlight style is applied.
public RichTextUser.Builder clientHighlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
Unlink
Sets whether the unlink style is applied.
public RichTextUser.Builder unlink(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUser
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextUser.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextUser
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextUser build()
Returns: an immutable RichTextUser
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextUser
RichTextUserGroup
A user group mention inside rich text.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
userGroupId.
See the Slack reference.
Builder
Starts a new builder.
public static RichTextUserGroup.Builder builder()
Returns: a new builder
Related types: RichTextUserGroup
GetUserGroupId
Returns the ID of the mentioned user group.
public String getUserGroupId()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetStyle
Returns the visual style.
public Optional<RichTextStyle> getStyle()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: RichTextStyle
UserGroupId
Sets the ID of the mentioned user group.
Required.
public RichTextUserGroup.Builder userGroupId(String value)
| Parameter | Description |
|---|---|
value | value for Slack's usergroup_id field |
Returns: this builder
Related types: RichTextUserGroup
Style
Sets the visual style.
Replaces any style flags already set.
public RichTextUserGroup.Builder style(RichTextStyle value)
| Parameter | Description |
|---|---|
value | the complete text style |
Returns: this builder
Related types: RichTextStyle, RichTextUserGroup
Bold
Sets whether the bold style is applied.
public RichTextUserGroup.Builder bold(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
Italic
Sets whether the italic style is applied.
public RichTextUserGroup.Builder italic(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
Strike
Sets whether the strike style is applied.
public RichTextUserGroup.Builder strike(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
Highlight
Sets whether the highlight style is applied.
public RichTextUserGroup.Builder highlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
ClientHighlight
Sets whether the client_highlight style is applied.
public RichTextUserGroup.Builder clientHighlight(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
Unlink
Sets whether the unlink style is applied.
public RichTextUserGroup.Builder unlink(boolean value)
| Parameter | Description |
|---|---|
value | whether to apply the style |
Returns: this builder
Related types: RichTextUserGroup
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public RichTextUserGroup.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: RichTextUserGroup
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public RichTextUserGroup build()
Returns: an immutable RichTextUserGroup
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: RichTextUserGroup
SlackFile
A reference to an image file hosted in Slack.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Provide exactly one of an ID or a URL.
See the Slack reference.
Builder
Starts a new builder.
public static SlackFile.Builder builder()
Returns: a new builder
Related types: SlackFile
GetId
Returns the ID of a file previously uploaded to Slack. Cannot be combined with a URL.
public Optional<String> getId()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetUrl
Returns the URL of a file hosted in Slack. Cannot be combined with an ID.
public Optional<String> getUrl()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Id
Sets the ID of a file previously uploaded to Slack. Cannot be combined with a URL.
public SlackFile.Builder id(String value)
| Parameter | Description |
|---|---|
value | value for Slack's id field |
Returns: this builder
Related types: SlackFile
Url
Sets the URL of a file hosted in Slack. Cannot be combined with an ID.
public SlackFile.Builder url(String value)
| Parameter | Description |
|---|---|
value | value for Slack's url field |
Returns: this builder
Related types: SlackFile
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public SlackFile.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: SlackFile
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public SlackFile build()
Returns: an immutable SlackFile
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: SlackFile
SlackIcon
A Slack-provided icon, referenced by name.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
See the Slack reference.
Builder
Starts a new builder.
public static SlackIcon.Builder builder()
Returns: a new builder
Related types: SlackIcon
GetName
Returns the name of the Slack-provided icon, such as rocket.
public Optional<String> getName()
Returns: the value, or an empty optional when it was not set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Name
Sets the name of the Slack-provided icon, such as rocket.
public SlackIcon.Builder name(String value)
| Parameter | Description |
|---|---|
value | value for Slack's name field |
Returns: this builder
Related types: SlackIcon
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public SlackIcon.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: SlackIcon
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public SlackIcon build()
Returns: an immutable SlackIcon
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: SlackIcon
Text
A Slack text composition object: plain text or mrkdwn.
Implemented by MarkdownText, PlainText.
Trigger
A link trigger that starts a workflow.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
url.
See the Slack reference.
Builder
Starts a new builder.
public static Trigger.Builder builder()
Returns: a new builder
Related types: Trigger
GetUrl
Returns the link trigger URL.
public String getUrl()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetCustomizableInputParameters
Returns the input values passed to the workflow's trigger.
public List<InputParameter> getCustomizableInputParameters()
Returns: the values in order, or an empty list when none were set
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: InputParameter
Url
Sets the link trigger URL.
Required.
public Trigger.Builder url(String value)
| Parameter | Description |
|---|---|
value | value for Slack's url field |
Returns: this builder
Related types: Trigger
CustomizableInputParameters
Adds the input values passed to the workflow's trigger.
Each call appends to any values already added.
public Trigger.Builder customizableInputParameters(InputParameter... values)
| Parameter | Description |
|---|---|
values | InputParameter values appended in order |
Returns: this builder
Related types: InputParameter, Trigger
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public Trigger.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: Trigger
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public Trigger build()
Returns: an immutable Trigger
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: Trigger
UrlSource
A linked source cited by a task card.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
url,text.
See the Slack reference.
Builder
Starts a new builder.
public static UrlSource.Builder builder()
Returns: a new builder
Related types: UrlSource
GetUrl
Returns the source URL.
public String getUrl()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
GetText
Returns the source link text.
public String getText()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Url
Sets the source URL.
Required. Must be between 1 and 3000 characters.
public UrlSource.Builder url(String value)
| Parameter | Description |
|---|---|
value | value for Slack's url field |
Returns: this builder
Related types: UrlSource
Text
Sets the source link text.
Required.
public UrlSource.Builder text(String value)
| Parameter | Description |
|---|---|
value | value for Slack's text field |
Returns: this builder
Related types: UrlSource
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public UrlSource.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: UrlSource
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public UrlSource build()
Returns: an immutable UrlSource
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: UrlSource
Workflow
The workflow started by a workflow button.
Start with builder(), set fields with the named fluent methods, and call Builder.build() to validate and create an immutable value.
- Required:
trigger.
See the Slack reference.
Builder
Starts a new builder.
public static Workflow.Builder builder()
Returns: a new builder
Related types: Workflow
GetTrigger
Returns the link trigger that starts the workflow.
public Trigger getTrigger()
Returns: the value
| Throws | When |
|---|---|
IllegalStateException | if the field was set through a raw wire field to a value this type cannot represent |
Related types: Trigger
Trigger
Sets the link trigger that starts the workflow.
Required.
public Workflow.Builder trigger(Trigger value)
| Parameter | Description |
|---|---|
value | nested Trigger |
Returns: this builder
Related types: Trigger, Workflow
WireField
Sets a Slack field that has no named method yet, such as a field Slack introduced after this release. Prefer the named methods, which are typed and documented.
The value is checked at build time like any other field. It must be a string, number, boolean, slackblocks value or builder, or a list or map containing only those.
public Workflow.Builder wireField(String field, Object value)
| Parameter | Description |
|---|---|
field | Slack JSON field name |
value | JSON-compatible value |
Returns: this builder
| Throws | When |
|---|---|
IllegalArgumentException | if the field name is empty or the value cannot be written as Slack JSON |
Related types: Workflow
Build
Validates the configured fields and creates an immutable value. The builder can be reused.
public Workflow build()
Returns: an immutable Workflow
| Throws | When |
|---|---|
ValidationException | if the value breaks a Block Kit rule, such as a missing required field or an exceeded length limit |
Related types: Workflow