Class SlackFormSelectElement

All Implemented Interfaces:
HasLabel, HasOptions

@Generated(from="AbstractSlackFormSelectElement", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class SlackFormSelectElement extends AbstractSlackFormSelectElement
Immutable implementation of AbstractSlackFormSelectElement.

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

  • Method Details

    • getOptions

      public List<SlackFormOption> getOptions()
      Returns:
      The value of the options attribute
    • getLabel

      public String getLabel()
      Returns:
      The value of the label attribute
    • getName

      public String getName()
      Specified by:
      getName in class SlackDialogFormElement
      Returns:
      The value of the name attribute
    • getPlaceholder

      public Optional<String> getPlaceholder()
      Specified by:
      getPlaceholder in class SlackDialogFormElement
      Returns:
      The value of the placeholder attribute
    • isOptional

      public Optional<Boolean> isOptional()
      Specified by:
      isOptional in class SlackDialogFormElement
      Returns:
      The value of the optional attribute
    • getType

      public SlackFormElementTypes getType()
      Overrides:
      getType in class AbstractSlackFormSelectElement
      Returns:
      The value of the type attribute
    • getDataSource

      public SlackDataSource getDataSource()
      Overrides:
      getDataSource in class AbstractSlackFormSelectElement
      Returns:
      The value of the dataSource attribute
    • getOptionGroups

      public List<SlackFormOptionGroup> getOptionGroups()
      Specified by:
      getOptionGroups in class AbstractSlackFormSelectElement
      Returns:
      The value of the optionGroups attribute
    • getValue

      public Optional<String> getValue()
      Specified by:
      getValue in class AbstractSlackFormSelectElement
      Returns:
      The value of the value attribute
    • getSelectedOptions

      public List<SlackFormOption> getSelectedOptions()
      Specified by:
      getSelectedOptions in class AbstractSlackFormSelectElement
      Returns:
      The value of the selectedOptions attribute
    • getMinQueryLength

      public Optional<Integer> getMinQueryLength()
      Specified by:
      getMinQueryLength in class AbstractSlackFormSelectElement
      Returns:
      The value of the minQueryLength attribute
    • withOptions

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

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

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

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

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

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

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

      public final SlackFormSelectElement withOptional(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the optional 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 optional
      Returns:
      A modified copy or this if not changed
    • withType

      public final SlackFormSelectElement withType(SlackFormElementTypes value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is 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
    • withDataSource

      public final SlackFormSelectElement withDataSource(SlackDataSource value)
      Copy the current immutable object by setting a value for the dataSource attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dataSource
      Returns:
      A modified copy or the this object
    • withOptionGroups

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

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

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

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

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

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackFormSelectElement 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: options, label, name, placeholder, optional, type, dataSource, optionGroups, value, selectedOptions, minQueryLength.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static SlackFormSelectElement.Builder builder()
      Creates a builder for SlackFormSelectElement.
       SlackFormSelectElement.builder()
          .addOptions|addAllOptions(SlackFormOption) // options elements
          .setLabel(String) // required label
          .setName(String) // required name
          .setPlaceholder(Optional<String>) // optional placeholder
          .setOptional(Optional<Boolean>) // optional optional
          .setType(com.hubspot.slack.client.models.dialog.form.SlackFormElementTypes) // optional type
          .setDataSource(com.hubspot.slack.client.models.actions.SlackDataSource) // optional dataSource
          .addOptionGroups|addAllOptionGroups(SlackFormOptionGroup) // optionGroups elements
          .setValue(Optional<String>) // optional value
          .addSelectedOptions|addAllSelectedOptions(SlackFormOption) // selectedOptions elements
          .setMinQueryLength(Optional<Integer>) // optional minQueryLength
          .build();
       
      Returns:
      A new SlackFormSelectElement builder