java.lang.Object
com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextPreformatted
All Implemented Interfaces:
BlockElement, RichTextObject, RichTextPreformattedIF

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

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

  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface BlockElement
      Specified by:
      getType in interface RichTextPreformattedIF
      Returns:
      The computed-at-construction value of the type attribute
    • getElements

      public com.google.common.collect.ImmutableList<RichTextElement> getElements()
      Specified by:
      getElements in interface RichTextPreformattedIF
      Returns:
      The value of the elements attribute
    • getBorder

      public Optional<Integer> getBorder()
      Specified by:
      getBorder in interface RichTextPreformattedIF
      Returns:
      The value of the border attribute
    • getLanguage

      public Optional<String> getLanguage()
      Specified by:
      getLanguage in interface RichTextPreformattedIF
      Returns:
      The value of the language attribute
    • withElements

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

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

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

      public final RichTextPreformatted withBorder(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the border 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 border
      Returns:
      A modified copy or this if not changed
    • withLanguage

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of RichTextPreformatted 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: type, elements, border, language.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static RichTextPreformatted.Builder builder()
      Creates a builder for RichTextPreformatted.
       RichTextPreformatted.builder()
          .addElements|addAllElements(com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextElement) // elements elements
          .setBorder(Optional<Integer>) // optional border
          .setLanguage(Optional<String>) // optional language
          .build();
       
      Returns:
      A new RichTextPreformatted builder