java.lang.Object
com.hubspot.slack.client.models.blocks.objects.Option
All Implemented Interfaces:
CompositionObject, OptionIF, OptionOrOptionGroup

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

Use the builder to create immutable instances: Option.builder(). Use the static factory method to create immutable instances: Option.of().

  • Method Details

    • getText

      public Text getText()
      Specified by:
      getText in interface OptionIF
      Returns:
      The value of the text attribute
    • getValue

      public String getValue()
      Specified by:
      getValue in interface OptionIF
      Returns:
      The value of the value attribute
    • getDescription

      public Optional<Text> getDescription()
      Specified by:
      getDescription in interface OptionIF
      Returns:
      The value of the description attribute
    • getUrl

      public Optional<String> getUrl()
      Specified by:
      getUrl in interface OptionIF
      Returns:
      The value of the url attribute
    • withText

      public final Option withText(Text value)
      Copy the current immutable object by setting a value for the text attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for text
      Returns:
      A modified copy or the this object
    • withValue

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

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

      public final Option withDescription(Optional<? extends Text> optional)
      Copy the current immutable object by setting an optional value for the description attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for description
      Returns:
      A modified copy or this if not changed
    • withUrl

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

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

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

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

      public static Option of(Text text, String value)
      Construct a new immutable Option instance.
      Parameters:
      text - The value for the text attribute
      value - The value for the value attribute
      Returns:
      An immutable Option instance
    • copyOf

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

      public static Option.Builder builder()
      Creates a builder for Option.
       Option.builder()
          .setText(com.hubspot.slack.client.models.blocks.objects.Text) // required text
          .setValue(String) // required value
          .setDescription(Optional<Text>) // optional description
          .setUrl(Optional<String>) // optional url
          .build();
       
      Returns:
      A new Option builder