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().

  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface BlockElement
      Specified by:
      getType in interface ButtonIF
      Returns:
      The computed-at-construction value of the type attribute
    • getText

      public Text getText()
      Specified by:
      getText in interface ButtonIF
      Returns:
      The value of the text attribute
    • getActionId

      public String getActionId()
      Specified by:
      getActionId in interface ButtonIF
      Specified by:
      getActionId in interface HasActionId
      Returns:
      The value of the actionId attribute
    • getUrl

      public Optional<String> getUrl()
      Specified by:
      getUrl in interface ButtonIF
      Returns:
      The value of the url attribute
    • getValue

      public Optional<String> getValue()
      Specified by:
      getValue in interface ButtonIF
      Returns:
      The value of the value attribute
    • getStyle

      public Optional<String> getStyle()
      Specified by:
      getStyle in interface ButtonIF
      Returns:
      The value of the style attribute
    • getConfirmationDialog

      public Optional<ConfirmationDialog> getConfirmationDialog()
      Specified by:
      getConfirmationDialog in interface ButtonIF
      Returns:
      The value of the confirmationDialog attribute
    • withText

      public final Button withText(Text value)
      Copy the current immutable object by setting a value for the text attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for text
      Returns:
      A modified copy or the this object
    • withActionId

      public final Button withActionId(String value)
      Copy the current immutable object by setting a value for the actionId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for actionId
      Returns:
      A modified copy or the this object
    • withUrl

      public final Button withUrl(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional url attribute.
      Parameters:
      value - The value for url, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withUrl

      public final Button withUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the url attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for url
      Returns:
      A modified copy or this if not changed
    • withValue

      public final Button withValue(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional value attribute.
      Parameters:
      value - The value for value, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withValue

      public final Button withValue(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the value attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for value
      Returns:
      A modified copy or this if not changed
    • withStyle

      public final Button withStyle(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional style attribute.
      Parameters:
      value - The value for style, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withStyle

      public final Button withStyle(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the style attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for style
      Returns:
      A modified copy or this if not changed
    • withConfirmationDialog

      public final Button withConfirmationDialog(@Nullable ConfirmationDialog value)
      Copy the current immutable object by setting a present value for the optional confirmationDialog attribute.
      Parameters:
      value - The value for confirmationDialog, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withConfirmationDialog

      public final Button withConfirmationDialog(Optional<? extends ConfirmationDialog> optional)
      Copy the current immutable object by setting an optional value for the confirmationDialog attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for confirmationDialog
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Button that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: type, text, actionId, url, value, style, confirmationDialog.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Button with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static Button of(Text text, String actionId)
      Construct a new immutable Button instance.
      Parameters:
      text - The value for the text attribute
      actionId - The value for the actionId attribute
      Returns:
      An immutable Button instance
    • copyOf

      public static Button copyOf(ButtonIF instance)
      Creates an immutable copy of a ButtonIF value. 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

      public static Button.Builder builder()
      Creates a builder for Button.
       Button.builder()
          .setText(com.hubspot.slack.client.models.blocks.objects.Text) // required text
          .setActionId(String) // required actionId
          .setUrl(Optional<String>) // optional url
          .setValue(Optional<String>) // optional value
          .setStyle(Optional<String>) // optional style
          .setConfirmationDialog(Optional<com.hubspot.slack.client.models.blocks.objects.ConfirmationDialog>) // optional confirmationDialog
          .build();
       
      Returns:
      A new Button builder