java.lang.Object
com.hubspot.slack.client.models.blocks.objects.Text
All Implemented Interfaces:
CompositionObject, ImageBlockOrText, TextIF

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

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

  • Method Details

    • getType

      public TextType getType()
      Specified by:
      getType in interface TextIF
      Returns:
      The value of the type attribute
    • getText

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

      public Optional<Boolean> isEmoji()
      Specified by:
      isEmoji in interface TextIF
      Returns:
      The value of the emoji attribute
    • isVerbatim

      public Optional<Boolean> isVerbatim()
      Specified by:
      isVerbatim in interface TextIF
      Returns:
      The value of the verbatim attribute
    • withType

      public final Text withType(TextType value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy or the this object
    • withText

      public final Text 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
    • withEmoji

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

      public final Text withEmoji(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the emoji 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 emoji
      Returns:
      A modified copy or this if not changed
    • withVerbatim

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

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

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

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

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

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

      public static Text.Builder builder()
      Creates a builder for Text.
       Text.builder()
          .setType(com.hubspot.slack.client.models.blocks.objects.TextType) // required type
          .setText(String) // required text
          .setEmoji(Optional<Boolean>) // optional emoji
          .setVerbatim(Optional<Boolean>) // optional verbatim
          .build();
       
      Returns:
      A new Text builder