Class ContainerBlock

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

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

Use the builder to create immutable instances: ContainerBlock.builder().

  • 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 ContainerBlockIF
      Returns:
      The computed-at-construction value of the type attribute
    • getTitle

      public Optional<Text> getTitle()
      Specified by:
      getTitle in interface ContainerBlockIF
      Returns:
      The value of the title attribute
    • getRichTextTitle

      public Optional<RichTextBlock> getRichTextTitle()
      Specified by:
      getRichTextTitle in interface ContainerBlockIF
      Returns:
      The value of the richTextTitle attribute
    • getChildBlocks

      public com.google.common.collect.ImmutableList<ContainerChildBlock> getChildBlocks()
      Specified by:
      getChildBlocks in interface ContainerBlockIF
      Returns:
      The value of the childBlocks attribute
    • getSubtitle

      public Optional<Text> getSubtitle()
      Specified by:
      getSubtitle in interface ContainerBlockIF
      Returns:
      The value of the subtitle attribute
    • getIcon

      public Optional<Image> getIcon()
      Specified by:
      getIcon in interface ContainerBlockIF
      Returns:
      The value of the icon attribute
    • getWidth

      public Optional<ContainerBlockWidth> getWidth()
      Specified by:
      getWidth in interface ContainerBlockIF
      Returns:
      The value of the width attribute
    • getHasHeaderDivider

      public Optional<Boolean> getHasHeaderDivider()
      Specified by:
      getHasHeaderDivider in interface ContainerBlockIF
      Returns:
      The value of the hasHeaderDivider attribute
    • isCollapsible

      public Optional<Boolean> isCollapsible()
      Specified by:
      isCollapsible in interface ContainerBlockIF
      Returns:
      The value of the collapsible attribute
    • isDefaultCollapsed

      public Optional<Boolean> isDefaultCollapsed()
      Specified by:
      isDefaultCollapsed in interface ContainerBlockIF
      Returns:
      The value of the defaultCollapsed attribute
    • withBlockId

      public final ContainerBlock 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 ContainerBlock 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
    • withTitle

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

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

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

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

      public final ContainerBlock withChildBlocks(ContainerChildBlock... elements)
      Copy the current immutable object with elements that replace the content of childBlocks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withChildBlocks

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

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

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

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

      public final ContainerBlock withIcon(Optional<? extends Image> optional)
      Copy the current immutable object by setting an optional value for the icon 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 icon
      Returns:
      A modified copy or this if not changed
    • withWidth

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

      public final ContainerBlock withWidth(Optional<? extends ContainerBlockWidth> optional)
      Copy the current immutable object by setting an optional value for the width 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 width
      Returns:
      A modified copy or this if not changed
    • withHasHeaderDivider

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

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

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

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ContainerBlock 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, title, richTextTitle, childBlocks, subtitle, icon, width, hasHeaderDivider, collapsible, defaultCollapsed.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ContainerBlock.Builder builder()
      Creates a builder for ContainerBlock.
       ContainerBlock.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setTitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional title
          .setRichTextTitle(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextBlock>) // optional richTextTitle
          .addChildBlocks|addAllChildBlocks(com.hubspot.slack.client.models.blocks.ContainerChildBlock) // childBlocks elements
          .setSubtitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional subtitle
          .setIcon(Optional<com.hubspot.slack.client.models.blocks.elements.Image>) // optional icon
          .setWidth(Optional<com.hubspot.slack.client.models.blocks.ContainerBlockWidth>) // optional width
          .setHasHeaderDivider(Optional<Boolean>) // optional hasHeaderDivider
          .setCollapsible(Optional<Boolean>) // optional collapsible
          .setDefaultCollapsed(Optional<Boolean>) // optional defaultCollapsed
          .build();
       
      Returns:
      A new ContainerBlock builder