Class SlackFormTextElement

All Implemented Interfaces:
HasLabel

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

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

  • Method Details

    • 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
    • getSubtype

      public Optional<SlackFormElementSubtypes> getSubtype()
      Specified by:
      getSubtype in class AbstractSlackDialogFormTextElement
      Returns:
      The value of the subtype attribute
    • getHint

      public Optional<String> getHint()
      Specified by:
      getHint in class AbstractSlackDialogFormTextElement
      Returns:
      The value of the hint attribute
    • getMinLength

      public int getMinLength()
      Overrides:
      getMinLength in class AbstractSlackDialogFormTextElement
      Returns:
      The value of the minLength attribute
    • getMaxLength

      public int getMaxLength()
      Overrides:
      getMaxLength in class AbstractSlackDialogFormTextElement
      Returns:
      The value of the maxLength attribute
    • getValue

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

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

      public final SlackFormTextElement 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 SlackFormTextElement 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 SlackFormTextElement 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 SlackFormTextElement 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 SlackFormTextElement 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 SlackFormTextElement 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
    • withSubtype

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

      public final SlackFormTextElement withSubtype(Optional<? extends SlackFormElementSubtypes> optional)
      Copy the current immutable object by setting an optional value for the subtype 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 subtype
      Returns:
      A modified copy or this if not changed
    • withHint

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

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

      public final SlackFormTextElement withMinLength(int value)
      Copy the current immutable object by setting a value for the minLength attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minLength
      Returns:
      A modified copy or the this object
    • withMaxLength

      public final SlackFormTextElement withMaxLength(int value)
      Copy the current immutable object by setting a value for the maxLength attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxLength
      Returns:
      A modified copy or the this object
    • withValue

      public final SlackFormTextElement 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 SlackFormTextElement 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
    • withType

      public final SlackFormTextElement 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of SlackFormTextElement 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: label, name, placeholder, optional, subtype, hint, minLength, maxLength, value, type.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static SlackFormTextElement.Builder builder()
      Creates a builder for SlackFormTextElement.
       SlackFormTextElement.builder()
          .setLabel(String) // required label
          .setName(String) // required name
          .setPlaceholder(Optional<String>) // optional placeholder
          .setOptional(Optional<Boolean>) // optional optional
          .setSubtype(Optional<com.hubspot.slack.client.models.dialog.form.SlackFormElementSubtypes>) // optional subtype
          .setHint(Optional<String>) // optional hint
          .setMinLength(int) // optional minLength
          .setMaxLength(int) // optional maxLength
          .setValue(Optional<String>) // optional value
          .setType(com.hubspot.slack.client.models.dialog.form.SlackFormElementTypes) // optional type
          .build();
       
      Returns:
      A new SlackFormTextElement builder