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

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

Use the builder to create immutable instances: RichTextDateElement.builder().

  • Method Details

    • getType

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

      public long getTimestamp()
      Specified by:
      getTimestamp in interface RichTextDateElementIF
      Returns:
      The value of the timestamp attribute
    • getFormat

      public String getFormat()
      Specified by:
      getFormat in interface RichTextDateElementIF
      Returns:
      The value of the format attribute
    • getUrl

      public Optional<String> getUrl()
      Specified by:
      getUrl in interface RichTextDateElementIF
      Returns:
      The value of the url attribute
    • getFallback

      public Optional<String> getFallback()
      Specified by:
      getFallback in interface RichTextDateElementIF
      Returns:
      The value of the fallback attribute
    • getStyle

      Specified by:
      getStyle in interface RichTextDateElementIF
      Returns:
      The value of the style attribute
    • withTimestamp

      public final RichTextDateElement withTimestamp(long value)
      Copy the current immutable object by setting a value for the timestamp attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for timestamp
      Returns:
      A modified copy or the this object
    • withFormat

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

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

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

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

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

      public final RichTextDateElement withStyle(@Nullable RichTextDateElementIF.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 RichTextDateElement withStyle(Optional<? extends RichTextDateElementIF.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 RichTextDateElement 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, timestamp, format, url, fallback, style.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static RichTextDateElement.Builder builder()
      Creates a builder for RichTextDateElement.
       RichTextDateElement.builder()
          .setTimestamp(long) // required timestamp
          .setFormat(String) // required format
          .setUrl(Optional<String>) // optional url
          .setFallback(Optional<String>) // optional fallback
          .setStyle(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextDateElementIF.StyleIF>) // optional style
          .build();
       
      Returns:
      A new RichTextDateElement builder