Class TaskCardBlock

java.lang.Object
com.hubspot.slack.client.models.blocks.TaskCardBlock
All Implemented Interfaces:
BlockOrAttachment, Block, TaskCardBlockIF, ChatUnfurlBlocksOrAttachment

@Generated(from="TaskCardBlockIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class TaskCardBlock extends Object implements TaskCardBlockIF
Slack's task_card block displays a single task, representing a single action.
See Also:
  • Method Details

    • getBlockId

      public Optional<String> getBlockId()
      Specified by:
      getBlockId in interface Block
      Returns:
      The value of the blockId attribute
    • getType

      public String getType()
      Specified by:
      getType in interface Block
      Specified by:
      getType in interface TaskCardBlockIF
      Returns:
      The computed-at-construction value of the type attribute
    • getTaskId

      public String getTaskId()
      Specified by:
      getTaskId in interface TaskCardBlockIF
      Returns:
      The value of the taskId attribute
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface TaskCardBlockIF
      Returns:
      The value of the title attribute
    • getDetails

      public Optional<RichTextBlock> getDetails()
      Specified by:
      getDetails in interface TaskCardBlockIF
      Returns:
      The value of the details attribute
    • getOutput

      public Optional<RichTextBlock> getOutput()
      Specified by:
      getOutput in interface TaskCardBlockIF
      Returns:
      The value of the output attribute
    • getSources

      public com.google.common.collect.ImmutableList<UrlSource> getSources()
      Specified by:
      getSources in interface TaskCardBlockIF
      Returns:
      The value of the sources attribute
    • getStatus

      public Optional<TaskCardBlockStatus> getStatus()
      Specified by:
      getStatus in interface TaskCardBlockIF
      Returns:
      The value of the status attribute
    • withBlockId

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

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

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

      public final TaskCardBlock withTitle(String value)
      Copy the current immutable object by setting a value for the title attribute. An equals check 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
    • withDetails

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

      public final TaskCardBlock withDetails(Optional<? extends RichTextBlock> optional)
      Copy the current immutable object by setting an optional value for the details 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 details
      Returns:
      A modified copy or this if not changed
    • withOutput

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

      public final TaskCardBlock withOutput(Optional<? extends RichTextBlock> optional)
      Copy the current immutable object by setting an optional value for the output 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 output
      Returns:
      A modified copy or this if not changed
    • withSources

      public final TaskCardBlock withSources(UrlSource... elements)
      Copy the current immutable object with elements that replace the content of sources.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSources

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

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

      public final TaskCardBlock withStatus(Optional<? extends TaskCardBlockStatus> optional)
      Copy the current immutable object by setting an optional value for the status 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 status
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of TaskCardBlock 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: blockId, type, taskId, title, details, output, sources, status.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static TaskCardBlock of(String taskId, String title)
      Construct a new immutable TaskCardBlock instance.
      Parameters:
      taskId - The value for the taskId attribute
      title - The value for the title attribute
      Returns:
      An immutable TaskCardBlock instance
    • copyOf

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

      public static TaskCardBlock.Builder builder()
      Creates a builder for TaskCardBlock.
       TaskCardBlock.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setTaskId(String) // required taskId
          .setTitle(String) // required title
          .setDetails(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextBlock>) // optional details
          .setOutput(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextBlock>) // optional output
          .addSources|addAllSources(com.hubspot.slack.client.models.blocks.elements.UrlSource) // sources elements
          .setStatus(Optional<com.hubspot.slack.client.models.blocks.TaskCardBlockStatus>) // optional status
          .build();
       
      Returns:
      A new TaskCardBlock builder