Class RichTextTextElement.Style

java.lang.Object
com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElement.Style
All Implemented Interfaces:
RichTextTextElementIF.StyleIF
Enclosing class:
RichTextTextElement

@Generated(from="RichTextTextElementIF.StyleIF", generator="Immutables") @Immutable public static final class RichTextTextElement.Style extends Object implements RichTextTextElementIF.StyleIF
Immutable implementation of RichTextTextElementIF.StyleIF.

Use the builder to create immutable instances: RichTextTextElement.Style.builder().

  • Method Details

    • getBold

      public Optional<Boolean> getBold()
      Specified by:
      getBold in interface RichTextTextElementIF.StyleIF
      Returns:
      The value of the bold attribute
    • getItalic

      public Optional<Boolean> getItalic()
      Specified by:
      getItalic in interface RichTextTextElementIF.StyleIF
      Returns:
      The value of the italic attribute
    • getStrike

      public Optional<Boolean> getStrike()
      Specified by:
      getStrike in interface RichTextTextElementIF.StyleIF
      Returns:
      The value of the strike attribute
    • getCode

      public Optional<Boolean> getCode()
      Specified by:
      getCode in interface RichTextTextElementIF.StyleIF
      Returns:
      The value of the code attribute
    • getUnderline

      public Optional<Boolean> getUnderline()
      Specified by:
      getUnderline in interface RichTextTextElementIF.StyleIF
      Returns:
      The value of the underline attribute
    • withBold

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

      public final RichTextTextElement.Style withBold(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the bold 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 bold
      Returns:
      A modified copy or this if not changed
    • withItalic

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

      public final RichTextTextElement.Style withItalic(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the italic 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 italic
      Returns:
      A modified copy or this if not changed
    • withStrike

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

      public final RichTextTextElement.Style withStrike(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the strike 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 strike
      Returns:
      A modified copy or this if not changed
    • withCode

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

      public final RichTextTextElement.Style withCode(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the code 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 code
      Returns:
      A modified copy or this if not changed
    • withUnderline

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

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

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

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

      Creates an immutable copy of a RichTextTextElementIF.StyleIF 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 Style instance
    • builder

      public static RichTextTextElement.Style.Builder builder()
      Creates a builder for Style.
       RichTextTextElement.Style.builder()
          .setBold(Optional<Boolean>) // optional bold
          .setItalic(Optional<Boolean>) // optional italic
          .setStrike(Optional<Boolean>) // optional strike
          .setCode(Optional<Boolean>) // optional code
          .setUnderline(Optional<Boolean>) // optional underline
          .build();
       
      Returns:
      A new Style builder