Class ContextActionsBlock

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

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

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

      public com.google.common.collect.ImmutableList<ContextActionsElement> getElements()
      Specified by:
      getElements in interface ContextActionsBlockIF
      Returns:
      The value of the elements attribute
    • withBlockId

      public final ContextActionsBlock 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 ContextActionsBlock 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
    • withElements

      public final ContextActionsBlock withElements(ContextActionsElement... elements)
      Copy the current immutable object with elements that replace the content of elements.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withElements

      public final ContextActionsBlock withElements(Iterable<? extends ContextActionsElement> elements)
      Copy the current immutable object with elements that replace the content of elements. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of elements elements to set
      Returns:
      A modified copy or this if not changed
    • equals

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

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

      public static ContextActionsBlock of(com.google.common.collect.ImmutableList<ContextActionsElement> elements)
      Construct a new immutable ContextActionsBlock instance.
      Parameters:
      elements - The value for the elements attribute
      Returns:
      An immutable ContextActionsBlock instance
    • of

      public static ContextActionsBlock of(Iterable<? extends ContextActionsElement> elements)
      Construct a new immutable ContextActionsBlock instance.
      Parameters:
      elements - The value for the elements attribute
      Returns:
      An immutable ContextActionsBlock instance
    • copyOf

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

      public static ContextActionsBlock.Builder builder()
      Creates a builder for ContextActionsBlock.
       ContextActionsBlock.builder()
          .setBlockId(Optional<String>) // optional blockId
          .addElements|addAllElements(com.hubspot.slack.client.models.blocks.elements.contextactionselements.ContextActionsElement) // elements elements
          .build();
       
      Returns:
      A new ContextActionsBlock builder