Class ViewInteractionPayload

java.lang.Object
com.hubspot.slack.client.models.interaction.ViewInteractionPayload
All Implemented Interfaces:
ViewInteractionPayloadIF, ViewPayloadBase

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

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

  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface ViewPayloadBase
      Returns:
      The value of the type attribute
    • getBlocks

      public List<Block> getBlocks()
      Specified by:
      getBlocks in interface ViewPayloadBase
      Returns:
      The value of the blocks attribute
    • getPrivateMetadata

      public Optional<String> getPrivateMetadata()
      Specified by:
      getPrivateMetadata in interface ViewPayloadBase
      Returns:
      The value of the privateMetadata attribute
    • getCallbackId

      public Optional<String> getCallbackId()
      Specified by:
      getCallbackId in interface ViewPayloadBase
      Returns:
      The value of the callbackId attribute
    • getExternalId

      public Optional<String> getExternalId()
      Specified by:
      getExternalId in interface ViewPayloadBase
      Returns:
      The value of the externalId attribute
    • getState

      public StateValuesPayload getState()
      Specified by:
      getState in interface ViewInteractionPayloadIF
      Returns:
      The value of the state attribute
    • getHash

      public String getHash()
      Specified by:
      getHash in interface ViewInteractionPayloadIF
      Returns:
      The value of the hash attribute
    • withType

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

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

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

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

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

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

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

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

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

      public final ViewInteractionPayload withState(StateValuesPayload value)
      Copy the current immutable object by setting a value for the state attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for state
      Returns:
      A modified copy or the this object
    • withHash

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

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

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

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

      public static ViewInteractionPayload.Builder builder()
      Creates a builder for ViewInteractionPayload.
       ViewInteractionPayload.builder()
          .setType(String) // required type
          .addBlocks|addAllBlocks(com.hubspot.slack.client.models.blocks.Block) // blocks elements
          .setPrivateMetadata(Optional<String>) // optional privateMetadata
          .setCallbackId(Optional<String>) // optional callbackId
          .setExternalId(Optional<String>) // optional externalId
          .setState(com.hubspot.slack.client.models.interaction.StateValuesPayload) // required state
          .setHash(String) // required hash
          .build();
       
      Returns:
      A new ViewInteractionPayload builder