java.lang.Object
com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElement
All Implemented Interfaces:
BlockElement, RichTextElement, RichTextTextElementIF

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

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

  • Method Details

    • getType

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

      public String getText()
      Specified by:
      getText in interface RichTextTextElementIF
      Returns:
      The value of the text attribute
    • getStyle

      Specified by:
      getStyle in interface RichTextTextElementIF
      Returns:
      The value of the style attribute
    • withText

      public final RichTextTextElement withText(String value)
      Copy the current immutable object by setting a value for the text attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for text
      Returns:
      A modified copy or the this object
    • withStyle

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

      public final RichTextTextElement withStyle(Optional<? extends RichTextTextElementIF.StyleIF> optional)
      Copy the current immutable object by setting an optional value for the style attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for style
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static RichTextTextElement of(String text)
      Construct a new immutable RichTextTextElement instance.
      Parameters:
      text - The value for the text attribute
      Returns:
      An immutable RichTextTextElement instance
    • copyOf

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

      public static RichTextTextElement.Builder builder()
      Creates a builder for RichTextTextElement.
       RichTextTextElement.builder()
          .setText(String) // required text
          .setStyle(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElementIF.StyleIF>) // optional style
          .build();
       
      Returns:
      A new RichTextTextElement builder