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

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

Use the builder to create immutable instances: Card.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 CardIF
      Returns:
      The computed-at-construction value of the type attribute
    • getHeroImage

      public Optional<Image> getHeroImage()
      Specified by:
      getHeroImage in interface CardIF
      Returns:
      The value of the heroImage attribute
    • getIcon

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

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

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

      public Optional<Text> getBody()
      Specified by:
      getBody in interface CardIF
      Returns:
      The value of the body attribute
    • getSubtext

      public Optional<Text> getSubtext()
      Specified by:
      getSubtext in interface CardIF
      Returns:
      The value of the subtext attribute
    • getActions

      public com.google.common.collect.ImmutableList<BlockElement> getActions()
      Specified by:
      getActions in interface CardIF
      Returns:
      The value of the actions attribute
    • getSlackIcon

      public Optional<SlackIconObject> getSlackIcon()
      Specified by:
      getSlackIcon in interface CardIF
      Returns:
      The value of the slackIcon attribute
    • withBlockId

      public final Card 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 Card 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
    • withHeroImage

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

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

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

      public final Card 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 Card 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
    • withSubtitle

      public final Card 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 Card 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
    • withBody

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

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

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

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

      public final Card withActions(BlockElement... elements)
      Copy the current immutable object with elements that replace the content of actions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withActions

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Card 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, heroImage, icon, title, subtitle, body, subtext, actions, slackIcon.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static Card.Builder builder()
      Creates a builder for Card.
       Card.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setHeroImage(Optional<com.hubspot.slack.client.models.blocks.elements.Image>) // optional heroImage
          .setIcon(Optional<com.hubspot.slack.client.models.blocks.elements.Image>) // optional icon
          .setTitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional title
          .setSubtitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional subtitle
          .setBody(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional body
          .setSubtext(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional subtext
          .addActions|addAllActions(com.hubspot.slack.client.models.blocks.elements.BlockElement) // actions elements
          .setSlackIcon(Optional<com.hubspot.slack.client.models.blocks.objects.SlackIconObject>) // optional slackIcon
          .build();
       
      Returns:
      A new Card builder