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

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

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

  • Method Details

    • getType

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

      public String getUrl()
      Specified by:
      getUrl in interface RichTextLinkElementIF
      Returns:
      The value of the url attribute
    • getText

      public Optional<String> getText()
      Specified by:
      getText in interface RichTextLinkElementIF
      Returns:
      The value of the text attribute
    • getUnsafe

      public Optional<Boolean> getUnsafe()
      Specified by:
      getUnsafe in interface RichTextLinkElementIF
      Returns:
      The value of the unsafe attribute
    • getStyle

      Specified by:
      getStyle in interface RichTextLinkElementIF
      Returns:
      The value of the style attribute
    • withUrl

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

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

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

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

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

      public final RichTextLinkElement withStyle(@Nullable RichTextLinkElementIF.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 RichTextLinkElement withStyle(Optional<? extends RichTextLinkElementIF.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 RichTextLinkElement 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, url, text, unsafe, style.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

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

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