Class ButtonElement
- java.lang.Object
-
- com.slack.api.model.block.element.BlockElement
-
- com.slack.api.model.block.element.ButtonElement
-
public class ButtonElement extends BlockElement
https://api.slack.com/reference/block-kit/block-elements#button
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ButtonElement.ButtonElementBuilder
-
Constructor Summary
Constructors Constructor Description ButtonElement()
ButtonElement(PlainTextObject text, String actionId, String url, String value, String style, ConfirmationDialogObject confirm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ButtonElement.ButtonElementBuilder
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
getActionId()
An identifier for this action.ConfirmationDialogObject
getConfirm()
A confirm object that defines an optional confirmation dialog after the button is clicked.String
getStyle()
Decorates buttons with alternative visual color schemes.PlainTextObject
getText()
A text object that defines the button's text.String
getType()
String
getUrl()
A URL to load in the user's browser when the button is clicked.String
getValue()
The value to send along with the interaction payload.int
hashCode()
void
setActionId(String actionId)
An identifier for this action.void
setConfirm(ConfirmationDialogObject confirm)
A confirm object that defines an optional confirmation dialog after the button is clicked.void
setStyle(String style)
Decorates buttons with alternative visual color schemes.void
setText(PlainTextObject text)
A text object that defines the button's text.void
setUrl(String url)
A URL to load in the user's browser when the button is clicked.void
setValue(String value)
The value to send along with the interaction payload.String
toString()
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ButtonElement
public ButtonElement()
-
ButtonElement
public ButtonElement(PlainTextObject text, String actionId, String url, String value, String style, ConfirmationDialogObject confirm)
-
-
Method Detail
-
builder
public static ButtonElement.ButtonElementBuilder builder()
-
getType
public String getType()
-
getText
public PlainTextObject getText()
A text object that defines the button's text. Can only be of type: plain_text. Maximum length for the text in this field is 75 characters.
-
getActionId
public String getActionId()
An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids used elsewhere by your app. Maximum length for this field is 255 characters.
-
getUrl
public String getUrl()
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000 characters. If you're using url, you'll still receive an interaction payload and will need to send an acknowledgement response.
-
getValue
public String getValue()
The value to send along with the interaction payload. Maximum length for this field is 2000 characters.
-
getStyle
public String getStyle()
Decorates buttons with alternative visual color schemes. Use this option with restraint.`primary` gives buttons a green outline and text, ideal for affirmation or confirmation actions. `primary` should only be used for one button within a set.
`danger` gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than `primary`.
If you don't include this field, the `default` button style will be used.
-
getConfirm
public ConfirmationDialogObject getConfirm()
A confirm object that defines an optional confirmation dialog after the button is clicked.
-
setText
public void setText(PlainTextObject text)
A text object that defines the button's text. Can only be of type: plain_text. Maximum length for the text in this field is 75 characters.
-
setActionId
public void setActionId(String actionId)
An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_ids used elsewhere by your app. Maximum length for this field is 255 characters.
-
setUrl
public void setUrl(String url)
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000 characters. If you're using url, you'll still receive an interaction payload and will need to send an acknowledgement response.
-
setValue
public void setValue(String value)
The value to send along with the interaction payload. Maximum length for this field is 2000 characters.
-
setStyle
public void setStyle(String style)
Decorates buttons with alternative visual color schemes. Use this option with restraint.`primary` gives buttons a green outline and text, ideal for affirmation or confirmation actions. `primary` should only be used for one button within a set.
`danger` gives buttons a red outline and text, and should be used when the action is destructive. Use danger even more sparingly than `primary`.
If you don't include this field, the `default` button style will be used.
-
setConfirm
public void setConfirm(ConfirmationDialogObject confirm)
A confirm object that defines an optional confirmation dialog after the button is clicked.
-
canEqual
protected boolean canEqual(Object other)
-
-