java.lang.Object
com.hubspot.slack.client.models.blocks.Header
All Implemented Interfaces:
BlockOrAttachment, Block, ContainerChildBlock, HeaderIF, ChatUnfurlBlocksOrAttachment

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

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

  • Method Details

    • getBlockId

      public Optional<String> getBlockId()
      Specified by:
      getBlockId in interface Block
      Returns:
      The value of the blockId attribute
    • getType

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

      public Text getText()
      Specified by:
      getText in interface HeaderIF
      Returns:
      The value of the text attribute
    • withBlockId

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

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

      public final Header withText(Text value)
      Copy the current immutable object by setting a value for the text attribute. A shallow reference equality check is 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
    • equals

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

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

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

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

      public static Header.Builder builder()
      Creates a builder for Header.
       Header.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setText(com.hubspot.slack.client.models.blocks.objects.Text) // required text
          .build();
       
      Returns:
      A new Header builder