Class Section.Builder

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

@Generated(from="SectionIF", generator="Immutables") @NotThreadSafe public static final class Section.Builder extends Object
Builds instances of type Section. 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 Section.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 Section.Builder from(SectionIF instance)
      Fill a builder with attribute values from the provided com.hubspot.slack.client.models.blocks.SectionIF instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setBlockId

      public final Section.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 Section.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
    • setText

      public final Section.Builder setText(@Nullable Text text)
      Initializes the value for the text attribute.

      If not set, this attribute will have a default value as returned by the initializer of text.

      Parameters:
      text - The value for text (can be null)
      Returns:
      this builder for use in a chained invocation
    • addFields

      public final Section.Builder addFields(Text element)
      Adds one element to fields list.
      Parameters:
      element - A fields element
      Returns:
      this builder for use in a chained invocation
    • addFields

      public final Section.Builder addFields(Text... elements)
      Adds elements to fields list.
      Parameters:
      elements - An array of fields elements
      Returns:
      this builder for use in a chained invocation
    • setFields

      public final Section.Builder setFields(Iterable<? extends Text> elements)
      Sets or replaces all elements for fields list.
      Parameters:
      elements - An iterable of fields elements
      Returns:
      this builder for use in a chained invocation
    • addAllFields

      public final Section.Builder addAllFields(Iterable<? extends Text> elements)
      Adds elements to fields list.
      Parameters:
      elements - An iterable of fields elements
      Returns:
      this builder for use in a chained invocation
    • setAccessory

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

      public final Section.Builder setAccessory(Optional<? extends BlockElement> accessory)
      Initializes the optional value accessory to accessory.
      Parameters:
      accessory - The value for accessory
      Returns:
      this builder for use in a chained invocation
    • build

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