Class ButtonElement
public class ButtonElement extends BlockElement
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classButtonElement.ButtonElementBuilder -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTYPE -
Constructor Summary
Constructors Constructor Description ButtonElement()ButtonElement(PlainTextObject text, java.lang.String actionId, java.lang.String url, java.lang.String value, java.lang.String style, ConfirmationDialogObject confirm) -
Method Summary
Modifier and Type Method Description static ButtonElement.ButtonElementBuilderbuilder()protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.lang.StringgetActionId()An identifier for this action.ConfirmationDialogObjectgetConfirm()A confirm object that defines an optional confirmation dialog after the button is clicked.java.lang.StringgetStyle()Decorates buttons with alternative visual color schemes.PlainTextObjectgetText()A text object that defines the button's text.java.lang.StringgetType()java.lang.StringgetUrl()A URL to load in the user's browser when the button is clicked.java.lang.StringgetValue()The value to send along with the interaction payload.inthashCode()voidsetActionId(java.lang.String actionId)An identifier for this action.voidsetConfirm(ConfirmationDialogObject confirm)A confirm object that defines an optional confirmation dialog after the button is clicked.voidsetStyle(java.lang.String style)Decorates buttons with alternative visual color schemes.voidsetText(PlainTextObject text)A text object that defines the button's text.voidsetUrl(java.lang.String url)A URL to load in the user's browser when the button is clicked.voidsetValue(java.lang.String value)The value to send along with the interaction payload.java.lang.StringtoString()
-
Field Details
-
TYPE
public static final java.lang.String TYPE- See Also:
- Constant Field Values
-
-
Constructor Details
-
ButtonElement
public ButtonElement() -
ButtonElement
public ButtonElement(PlainTextObject text, java.lang.String actionId, java.lang.String url, java.lang.String value, java.lang.String style, ConfirmationDialogObject confirm)
-
-
Method Details
-
builder
-
getType
public java.lang.String getType() -
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 java.lang.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 java.lang.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 java.lang.String getValue()The value to send along with the interaction payload. Maximum length for this field is 2000 characters. -
getStyle
public java.lang.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
A confirm object that defines an optional confirmation dialog after the button is clicked. -
setText
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(java.lang.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(java.lang.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(java.lang.String value)The value to send along with the interaction payload. Maximum length for this field is 2000 characters. -
setStyle
public void setStyle(java.lang.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
A confirm object that defines an optional confirmation dialog after the button is clicked. -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-