Class Option
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().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Option.Builderbuilder()Creates a builder forOption.static OptionCreates an immutable copy of aOptionIFvalue.booleanThis instance is equal to all instances ofOptionthat have equal attribute values.getText()getUrl()getValue()inthashCode()Computes a hash code from attributes:text,value,description,url.static OptionConstruct a new immutableOptioninstance.toString()Prints the immutable valueOptionwith attribute values.final OptionwithDescription(Text value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final OptionwithDescription(Optional<? extends Text> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final OptionCopy the current immutable object by setting a value for thetextattribute.final OptionCopy the current immutable object by setting a present value for the optionalurlattribute.final OptionCopy the current immutable object by setting an optional value for theurlattribute.final OptionCopy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
getText
-
getValue
-
getDescription
- Specified by:
getDescriptionin interfaceOptionIF- Returns:
- The value of the
descriptionattribute
-
getUrl
-
withText
Copy the current immutable object by setting a value for thetextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy or the
thisobject
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy or the
thisobject
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for description- Returns:
- A modified copy or
thisif not changed
-
withUrl
Copy the current immutable object by setting a present value for the optionalurlattribute.- Parameters:
value- The value for url,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withUrl
Copy the current immutable object by setting an optional value for theurlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for url- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofOptionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:text,value,description,url. -
toString
Prints the immutable valueOptionwith attribute values. -
of
Construct a new immutableOptioninstance.- Parameters:
text- The value for thetextattributevalue- The value for thevalueattribute- Returns:
- An immutable Option instance
-
copyOf
Creates an immutable copy of aOptionIFvalue. 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
Creates a builder forOption.Option.builder() .setText(com.hubspot.slack.client.models.blocks.objects.Text) // requiredtext.setValue(String) // requiredvalue.setDescription(Optional<Text>) // optionaldescription.setUrl(Optional<String>) // optionalurl.build();- Returns:
- A new Option builder
-