Class RichTextPreformatted.Builder

java.lang.Object
com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextPreformatted.Builder
Enclosing class:
RichTextPreformatted

@Generated(from="RichTextPreformattedIF", generator="Immutables") @NotThreadSafe public static final class RichTextPreformatted.Builder extends Object
Builds instances of type RichTextPreformatted. 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

      Fill a builder with attribute values from the provided RichTextPreformattedIF instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • addElements

      public final RichTextPreformatted.Builder addElements(RichTextElement element)
      Adds one element to elements list.
      Parameters:
      element - A elements element
      Returns:
      this builder for use in a chained invocation
    • addElements

      public final RichTextPreformatted.Builder addElements(RichTextElement... elements)
      Adds elements to elements list.
      Parameters:
      elements - An array of elements elements
      Returns:
      this builder for use in a chained invocation
    • setElements

      public final RichTextPreformatted.Builder setElements(Iterable<? extends RichTextElement> elements)
      Sets or replaces all elements for elements list.
      Parameters:
      elements - An iterable of elements elements
      Returns:
      this builder for use in a chained invocation
    • addAllElements

      public final RichTextPreformatted.Builder addAllElements(Iterable<? extends RichTextElement> elements)
      Adds elements to elements list.
      Parameters:
      elements - An iterable of elements elements
      Returns:
      this builder for use in a chained invocation
    • setBorder

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

      public final RichTextPreformatted.Builder setBorder(Optional<Integer> border)
      Initializes the optional value border to border.
      Parameters:
      border - The value for border
      Returns:
      this builder for use in a chained invocation
    • setLanguage

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

      public final RichTextPreformatted.Builder setLanguage(Optional<String> language)
      Initializes the optional value language to language.
      Parameters:
      language - The value for language
      Returns:
      this builder for use in a chained invocation
    • build

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