Class Option
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().
-
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()getValue()inthashCode()Computes a hash code from attributes:text,value.toString()Prints the immutable valueOptionwith attribute values.final OptionCopy the current immutable object by setting a present value for the optionaltextattribute.final OptionCopy the current immutable object by setting an optional value for thetextattribute.final OptionCopy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
getText
-
getValue
-
withText
Copy the current immutable object by setting a present value for the optionaltextattribute.- Parameters:
value- The value for text,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withText
Copy the current immutable object by setting an optional value for thetextattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for text- Returns:
- A modified copy or
thisif not changed
-
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
-
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. -
toString
Prints the immutable valueOptionwith attribute values. -
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(Optional<String>) // optionaltext.setValue(String) // requiredvalue.build();- Returns:
- A new Option builder
-