java.lang.Object
com.hubspot.slack.client.models.actions.Option
All Implemented Interfaces:
OptionIF

@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().

  • Method Details

    • getText

      public Optional<String> 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
    • withText

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

      public final Option withText(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the text 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 text
      Returns:
      A modified copy or this if not changed
    • 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
    • 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.
      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
    • 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(Optional<String>) // optional text
          .setValue(String) // required value
          .build();
       
      Returns:
      A new Option builder