Class Card.Builder

java.lang.Object
com.hubspot.slack.client.models.blocks.Card.Builder
Enclosing class:
Card

@Generated(from="CardIF", generator="Immutables") @NotThreadSafe public static final class Card.Builder extends Object
Builds instances of type Card. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final Card.Builder from(Block instance)
      Fill a builder with attribute values from the provided com.hubspot.slack.client.models.blocks.Block instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final Card.Builder from(CardIF instance)
      Fill a builder with attribute values from the provided com.hubspot.slack.client.models.blocks.CardIF instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setBlockId

      public final Card.Builder setBlockId(@Nullable String blockId)
      Initializes the optional value blockId to blockId.
      Parameters:
      blockId - The value for blockId, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setBlockId

      public final Card.Builder setBlockId(Optional<String> blockId)
      Initializes the optional value blockId to blockId.
      Parameters:
      blockId - The value for blockId
      Returns:
      this builder for use in a chained invocation
    • setHeroImage

      public final Card.Builder setHeroImage(@Nullable Image heroImage)
      Initializes the optional value heroImage to heroImage.
      Parameters:
      heroImage - The value for heroImage, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setHeroImage

      public final Card.Builder setHeroImage(Optional<? extends Image> heroImage)
      Initializes the optional value heroImage to heroImage.
      Parameters:
      heroImage - The value for heroImage
      Returns:
      this builder for use in a chained invocation
    • setIcon

      public final Card.Builder setIcon(@Nullable Image icon)
      Initializes the optional value icon to icon.
      Parameters:
      icon - The value for icon, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setIcon

      public final Card.Builder setIcon(Optional<? extends Image> icon)
      Initializes the optional value icon to icon.
      Parameters:
      icon - The value for icon
      Returns:
      this builder for use in a chained invocation
    • setTitle

      public final Card.Builder setTitle(@Nullable Text title)
      Initializes the optional value title to title.
      Parameters:
      title - The value for title, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setTitle

      public final Card.Builder setTitle(Optional<? extends Text> title)
      Initializes the optional value title to title.
      Parameters:
      title - The value for title
      Returns:
      this builder for use in a chained invocation
    • setSubtitle

      public final Card.Builder setSubtitle(@Nullable Text subtitle)
      Initializes the optional value subtitle to subtitle.
      Parameters:
      subtitle - The value for subtitle, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setSubtitle

      public final Card.Builder setSubtitle(Optional<? extends Text> subtitle)
      Initializes the optional value subtitle to subtitle.
      Parameters:
      subtitle - The value for subtitle
      Returns:
      this builder for use in a chained invocation
    • setBody

      public final Card.Builder setBody(@Nullable Text body)
      Initializes the optional value body to body.
      Parameters:
      body - The value for body, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setBody

      public final Card.Builder setBody(Optional<? extends Text> body)
      Initializes the optional value body to body.
      Parameters:
      body - The value for body
      Returns:
      this builder for use in a chained invocation
    • setSubtext

      public final Card.Builder setSubtext(@Nullable Text subtext)
      Initializes the optional value subtext to subtext.
      Parameters:
      subtext - The value for subtext, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setSubtext

      public final Card.Builder setSubtext(Optional<? extends Text> subtext)
      Initializes the optional value subtext to subtext.
      Parameters:
      subtext - The value for subtext
      Returns:
      this builder for use in a chained invocation
    • addActions

      public final Card.Builder addActions(BlockElement element)
      Adds one element to actions list.
      Parameters:
      element - A actions element
      Returns:
      this builder for use in a chained invocation
    • addActions

      public final Card.Builder addActions(BlockElement... elements)
      Adds elements to actions list.
      Parameters:
      elements - An array of actions elements
      Returns:
      this builder for use in a chained invocation
    • setActions

      public final Card.Builder setActions(Iterable<? extends BlockElement> elements)
      Sets or replaces all elements for actions list.
      Parameters:
      elements - An iterable of actions elements
      Returns:
      this builder for use in a chained invocation
    • addAllActions

      public final Card.Builder addAllActions(Iterable<? extends BlockElement> elements)
      Adds elements to actions list.
      Parameters:
      elements - An iterable of actions elements
      Returns:
      this builder for use in a chained invocation
    • setSlackIcon

      public final Card.Builder setSlackIcon(@Nullable SlackIconObject slackIcon)
      Initializes the optional value slackIcon to slackIcon.
      Parameters:
      slackIcon - The value for slackIcon, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setSlackIcon

      public final Card.Builder setSlackIcon(Optional<? extends SlackIconObject> slackIcon)
      Initializes the optional value slackIcon to slackIcon.
      Parameters:
      slackIcon - The value for slackIcon
      Returns:
      this builder for use in a chained invocation
    • build

      public Card build()
      Builds a new Card.
      Returns:
      An immutable instance of Card
      Throws:
      com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missing