Class DataTable

java.lang.Object
com.hubspot.slack.client.models.blocks.DataTable
All Implemented Interfaces:
BlockOrAttachment, Block, DataTableIF, ChatUnfurlBlocksOrAttachment

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

Use the builder to create immutable instances: DataTable.builder(). Use the static factory method to create immutable instances: DataTable.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 DataTableIF
      Returns:
      The computed-at-construction value of the type attribute
    • getCaption

      public Optional<String> getCaption()
      Specified by:
      getCaption in interface DataTableIF
      Returns:
      The value of the caption attribute
    • getRows

      public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<DataTableCell>> getRows()
      Specified by:
      getRows in interface DataTableIF
      Returns:
      The value of the rows attribute
    • getPageSize

      public Optional<Integer> getPageSize()
      Specified by:
      getPageSize in interface DataTableIF
      Returns:
      The value of the pageSize attribute
    • getRowHeaderColumnIndex

      public Optional<Integer> getRowHeaderColumnIndex()
      Specified by:
      getRowHeaderColumnIndex in interface DataTableIF
      Returns:
      The value of the rowHeaderColumnIndex attribute
    • withBlockId

      public final DataTable 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 DataTable 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
    • withCaption

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

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

      @SafeVarargs public final DataTable withRows(com.google.common.collect.ImmutableList<DataTableCell>... elements)
      Copy the current immutable object with elements that replace the content of rows.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withRows

      public final DataTable withRows(Iterable<? extends com.google.common.collect.ImmutableList<DataTableCell>> elements)
      Copy the current immutable object with elements that replace the content of rows. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of rows elements to set
      Returns:
      A modified copy or this if not changed
    • withPageSize

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

      public final DataTable withPageSize(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the pageSize 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 pageSize
      Returns:
      A modified copy or this if not changed
    • withRowHeaderColumnIndex

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

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

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

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

      public static DataTable of(Optional<String> caption, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<DataTableCell>> rows)
      Construct a new immutable DataTable instance.
      Parameters:
      caption - The value for the caption attribute
      rows - The value for the rows attribute
      Returns:
      An immutable DataTable instance
    • of

      public static DataTable of(Optional<String> caption, Iterable<? extends com.google.common.collect.ImmutableList<DataTableCell>> rows)
      Construct a new immutable DataTable instance.
      Parameters:
      caption - The value for the caption attribute
      rows - The value for the rows attribute
      Returns:
      An immutable DataTable instance
    • of

      public static DataTable of(@Nullable String caption, Iterable<? extends com.google.common.collect.ImmutableList<DataTableCell>> rows)
      Construct a new immutable DataTable instance.
      Parameters:
      caption - The value for the caption attribute
      rows - The value for the rows attribute
      Returns:
      An immutable DataTable instance
    • copyOf

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

      public static DataTable.Builder builder()
      Creates a builder for DataTable.
       DataTable.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setCaption(Optional<String>) // optional caption
          .addRows|addAllRows(com.google.common.collect.ImmutableList<com.hubspot.slack.client.models.blocks.table.DataTableCell>) // rows elements
          .setPageSize(Optional<Integer>) // optional pageSize
          .setRowHeaderColumnIndex(Optional<Integer>) // optional rowHeaderColumnIndex
          .build();
       
      Returns:
      A new DataTable builder