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

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

Use the builder to create immutable instances: RichTextList.builder(). Use the static factory method to create immutable instances: RichTextList.of().

  • Method Details

    • getType

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

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

      public RichTextListStyle getStyle()
      Specified by:
      getStyle in interface RichTextListIF
      Returns:
      The value of the style attribute
    • getIndent

      public Optional<Integer> getIndent()
      Specified by:
      getIndent in interface RichTextListIF
      Returns:
      The value of the indent attribute
    • getBorder

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

      public Optional<Integer> getOffset()
      Specified by:
      getOffset in interface RichTextListIF
      Returns:
      The value of the offset attribute
    • withElements

      public final RichTextList withElements(RichTextSection... 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 RichTextList withElements(Iterable<? extends RichTextSection> 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
    • withStyle

      public final RichTextList withStyle(RichTextListStyle value)
      Copy the current immutable object by setting a value for the style attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for style
      Returns:
      A modified copy or the this object
    • withIndent

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

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

      public final RichTextList 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 RichTextList 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
    • withOffset

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

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

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

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

      public static RichTextList of(RichTextListStyle style)
      Construct a new immutable RichTextList instance.
      Parameters:
      style - The value for the style attribute
      Returns:
      An immutable RichTextList instance
    • copyOf

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

      public static RichTextList.Builder builder()
      Creates a builder for RichTextList.
       RichTextList.builder()
          .addElements|addAllElements(RichTextSection) // elements elements
          .setStyle(com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextListStyle) // required style
          .setIndent(Optional<Integer>) // optional indent
          .setBorder(Optional<Integer>) // optional border
          .setOffset(Optional<Integer>) // optional offset
          .build();
       
      Returns:
      A new RichTextList builder