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

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

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

  • Method Details

    • getLabel

      public Text getLabel()
      Specified by:
      getLabel in interface OptionGroupIF
      Returns:
      The value of the label attribute
    • getOptions

      public List<Option> getOptions()
      Specified by:
      getOptions in interface OptionGroupIF
      Returns:
      The value of the options attribute
    • withLabel

      public final OptionGroup withLabel(Text value)
      Copy the current immutable object by setting a value for the label attribute. A shallow reference equality check is 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
    • withOptions

      public final OptionGroup withOptions(Option... 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 OptionGroup withOptions(Iterable<? extends Option> 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
    • equals

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

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

      public static OptionGroup of(Text label, List<Option> options)
      Construct a new immutable OptionGroup instance.
      Parameters:
      label - The value for the label attribute
      options - The value for the options attribute
      Returns:
      An immutable OptionGroup instance
    • of

      public static OptionGroup of(Text label, Iterable<? extends Option> options)
      Construct a new immutable OptionGroup instance.
      Parameters:
      label - The value for the label attribute
      options - The value for the options attribute
      Returns:
      An immutable OptionGroup instance
    • copyOf

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

      public static OptionGroup.Builder builder()
      Creates a builder for OptionGroup.
       OptionGroup.builder()
          .setLabel(com.hubspot.slack.client.models.blocks.objects.Text) // required label
          .addOptions|addAllOptions(Option) // options elements
          .build();
       
      Returns:
      A new OptionGroup builder