Class ModalViewPayload

java.lang.Object
com.hubspot.slack.client.models.views.ModalViewPayload
All Implemented Interfaces:
ModalViewPayloadBase, ModalViewPayloadIF, ViewPayloadBase, ViewPayloadJsonBase

@Generated(from="ModalViewPayloadIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ModalViewPayload extends Object implements ModalViewPayloadIF
Immutable implementation of ModalViewPayloadIF.

Use the builder to create immutable instances: ModalViewPayload.builder(). Use the static factory method to create immutable instances: ModalViewPayload.of().

  • Method Details

    • getPrivateMetadata

      public Optional<String> getPrivateMetadata()
      Specified by:
      getPrivateMetadata in interface ViewPayloadBase
      Returns:
      The value of the privateMetadata attribute
    • getCallbackId

      public Optional<String> getCallbackId()
      Specified by:
      getCallbackId in interface ViewPayloadBase
      Returns:
      The value of the callbackId attribute
    • getExternalId

      public Optional<String> getExternalId()
      Specified by:
      getExternalId in interface ViewPayloadBase
      Returns:
      The value of the externalId attribute
    • getType

      public String getType()
      Specified by:
      getType in interface ModalViewPayloadBase
      Specified by:
      getType in interface ViewPayloadBase
      Returns:
      The computed-at-construction value of the type attribute
    • getCloseButtonText

      public Optional<Text> getCloseButtonText()
      Specified by:
      getCloseButtonText in interface ModalViewPayloadBase
      Returns:
      The value of the closeButtonText attribute
    • getSubmitButtonText

      public Optional<Text> getSubmitButtonText()
      Specified by:
      getSubmitButtonText in interface ModalViewPayloadBase
      Returns:
      The value of the submitButtonText attribute
    • getClearOnClose

      public Optional<Boolean> getClearOnClose()
      Specified by:
      getClearOnClose in interface ModalViewPayloadBase
      Returns:
      The value of the clearOnClose attribute
    • getNotifyOnClose

      public Optional<Boolean> getNotifyOnClose()
      Specified by:
      getNotifyOnClose in interface ModalViewPayloadBase
      Returns:
      The value of the notifyOnClose attribute
    • getTitle

      public Text getTitle()
      Specified by:
      getTitle in interface ModalViewPayloadBase
      Specified by:
      getTitle in interface ModalViewPayloadIF
      Returns:
      The value of the title attribute
    • getBlocks

      public List<Block> getBlocks()
      Specified by:
      getBlocks in interface ModalViewPayloadIF
      Specified by:
      getBlocks in interface ViewPayloadBase
      Returns:
      The value of the blocks attribute
    • withPrivateMetadata

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

      public final ModalViewPayload withPrivateMetadata(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the privateMetadata 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 privateMetadata
      Returns:
      A modified copy or this if not changed
    • withCallbackId

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

      public final ModalViewPayload withCallbackId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the callbackId 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 callbackId
      Returns:
      A modified copy or this if not changed
    • withExternalId

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

      public final ModalViewPayload withExternalId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the externalId 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 externalId
      Returns:
      A modified copy or this if not changed
    • withCloseButtonText

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

      public final ModalViewPayload withCloseButtonText(Optional<? extends Text> optional)
      Copy the current immutable object by setting an optional value for the closeButtonText 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 closeButtonText
      Returns:
      A modified copy or this if not changed
    • withSubmitButtonText

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

      public final ModalViewPayload withSubmitButtonText(Optional<? extends Text> optional)
      Copy the current immutable object by setting an optional value for the submitButtonText 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 submitButtonText
      Returns:
      A modified copy or this if not changed
    • withClearOnClose

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

      public final ModalViewPayload withClearOnClose(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the clearOnClose 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 clearOnClose
      Returns:
      A modified copy or this if not changed
    • withNotifyOnClose

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

      public final ModalViewPayload withNotifyOnClose(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the notifyOnClose 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 notifyOnClose
      Returns:
      A modified copy or this if not changed
    • withTitle

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

      public final ModalViewPayload withBlocks(Block... elements)
      Copy the current immutable object with elements that replace the content of blocks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBlocks

      public final ModalViewPayload withBlocks(Iterable<? extends Block> elements)
      Copy the current immutable object with elements that replace the content of blocks. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of blocks elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ModalViewPayload 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: privateMetadata, callbackId, externalId, type, closeButtonText, submitButtonText, clearOnClose, notifyOnClose, title, blocks.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ModalViewPayload of(Text title, List<Block> blocks)
      Construct a new immutable ModalViewPayload instance.
      Parameters:
      title - The value for the title attribute
      blocks - The value for the blocks attribute
      Returns:
      An immutable ModalViewPayload instance
    • of

      public static ModalViewPayload of(Text title, Iterable<? extends Block> blocks)
      Construct a new immutable ModalViewPayload instance.
      Parameters:
      title - The value for the title attribute
      blocks - The value for the blocks attribute
      Returns:
      An immutable ModalViewPayload instance
    • copyOf

      public static ModalViewPayload copyOf(ModalViewPayloadIF instance)
      Creates an immutable copy of a ModalViewPayloadIF 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 ModalViewPayload instance
    • builder

      public static ModalViewPayload.Builder builder()
      Creates a builder for ModalViewPayload.
       ModalViewPayload.builder()
          .setPrivateMetadata(Optional<String>) // optional privateMetadata
          .setCallbackId(Optional<String>) // optional callbackId
          .setExternalId(Optional<String>) // optional externalId
          .setCloseButtonText(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional closeButtonText
          .setSubmitButtonText(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional submitButtonText
          .setClearOnClose(Optional<Boolean>) // optional clearOnClose
          .setNotifyOnClose(Optional<Boolean>) // optional notifyOnClose
          .setTitle(com.hubspot.slack.client.models.blocks.objects.Text) // required title
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .build();
       
      Returns:
      A new ModalViewPayload builder