Class Button
java.lang.Object
com.hubspot.slack.client.models.blocks.elements.Button
- All Implemented Interfaces:
BlockElement,ButtonIF,HasActionId
@Generated(from="ButtonIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Button
extends Object
implements ButtonIF
Immutable implementation of
ButtonIF.
Use the builder to create immutable instances:
Button.builder().
Use the static factory method to create immutable instances:
Button.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Button.Builderbuilder()Creates a builder forButton.static ButtonCreates an immutable copy of aButtonIFvalue.booleanThis instance is equal to all instances ofButtonthat have equal attribute values.getStyle()getText()getType()getUrl()getValue()inthashCode()Computes a hash code from attributes:type,text,actionId,url,value,style,confirmationDialog.static ButtonConstruct a new immutableButtoninstance.toString()Prints the immutable valueButtonwith attribute values.final ButtonwithActionId(String value) Copy the current immutable object by setting a value for theactionIdattribute.final ButtonCopy the current immutable object by setting a present value for the optionalconfirmationDialogattribute.final ButtonwithConfirmationDialog(Optional<? extends ConfirmationDialog> optional) Copy the current immutable object by setting an optional value for theconfirmationDialogattribute.final ButtonCopy the current immutable object by setting a present value for the optionalstyleattribute.final ButtonCopy the current immutable object by setting an optional value for thestyleattribute.final ButtonCopy the current immutable object by setting a value for thetextattribute.final ButtonCopy the current immutable object by setting a present value for the optionalurlattribute.final ButtonCopy the current immutable object by setting an optional value for theurlattribute.final ButtonCopy the current immutable object by setting a present value for the optionalvalueattribute.final ButtonCopy the current immutable object by setting an optional value for thevalueattribute.
-
Method Details
-
getType
- Specified by:
getTypein interfaceBlockElement- Specified by:
getTypein interfaceButtonIF- Returns:
- The computed-at-construction value of the
typeattribute
-
getText
-
getActionId
- Specified by:
getActionIdin interfaceButtonIF- Specified by:
getActionIdin interfaceHasActionId- Returns:
- The value of the
actionIdattribute
-
getUrl
-
getValue
-
getStyle
-
getConfirmationDialog
- Specified by:
getConfirmationDialogin interfaceButtonIF- Returns:
- The value of the
confirmationDialogattribute
-
withText
Copy the current immutable object by setting a value for thetextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy or the
thisobject
-
withActionId
Copy the current immutable object by setting a value for theactionIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for actionId- Returns:
- A modified copy or the
thisobject
-
withUrl
Copy the current immutable object by setting a present value for the optionalurlattribute.- Parameters:
value- The value for url,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withUrl
Copy the current immutable object by setting an optional value for theurlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for url- Returns:
- A modified copy or
thisif not changed
-
withValue
Copy the current immutable object by setting a present value for the optionalvalueattribute.- Parameters:
value- The value for value,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withValue
Copy the current immutable object by setting an optional value for thevalueattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for value- Returns:
- A modified copy or
thisif not changed
-
withStyle
Copy the current immutable object by setting a present value for the optionalstyleattribute.- Parameters:
value- The value for style,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withStyle
Copy the current immutable object by setting an optional value for thestyleattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for style- Returns:
- A modified copy or
thisif not changed
-
withConfirmationDialog
Copy the current immutable object by setting a present value for the optionalconfirmationDialogattribute.- Parameters:
value- The value for confirmationDialog,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withConfirmationDialog
Copy the current immutable object by setting an optional value for theconfirmationDialogattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for confirmationDialog- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofButtonthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,text,actionId,url,value,style,confirmationDialog. -
toString
Prints the immutable valueButtonwith attribute values. -
of
Construct a new immutableButtoninstance.- Parameters:
text- The value for thetextattributeactionId- The value for theactionIdattribute- Returns:
- An immutable Button instance
-
copyOf
Creates an immutable copy of aButtonIFvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Button instance
-
builder
Creates a builder forButton.Button.builder() .setText(com.hubspot.slack.client.models.blocks.objects.Text) // requiredtext.setActionId(String) // requiredactionId.setUrl(Optional<String>) // optionalurl.setValue(Optional<String>) // optionalvalue.setStyle(Optional<String>) // optionalstyle.setConfirmationDialog(Optional<com.hubspot.slack.client.models.blocks.objects.ConfirmationDialog>) // optionalconfirmationDialog.build();- Returns:
- A new Button builder
-