@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","OptionIF"}) @Immutable public final class Option extends Object implements OptionIF
OptionIF.
Use the builder to create immutable instances:
Option.builder().
Use the static factory method to create immutable instances:
Option.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
Option.Builder
Builds instances of type
Option. |
| Modifier and Type | Method and Description |
|---|---|
static Option.Builder |
builder()
Creates a builder for
Option. |
static Option |
copyOf(OptionIF instance)
Creates an immutable copy of a
OptionIF value. |
boolean |
equals(Object another)
This instance is equal to all instances of
Option that have equal attribute values. |
Text |
getText() |
Optional<String> |
getUrl() |
String |
getValue() |
int |
hashCode()
Computes a hash code from attributes:
text, value, url. |
static Option |
of(Text text,
String value)
Construct a new immutable
Option instance. |
String |
toString()
Prints the immutable value
Option with attribute values. |
Option |
withText(Text text)
Copy the current immutable object by setting a value for the
text attribute. |
Option |
withUrl(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
url attribute. |
Option |
withUrl(String value)
Copy the current immutable object by setting a present value for the optional
url attribute. |
Option |
withValue(String value)
Copy the current immutable object by setting a value for the
value attribute. |
public Text getText()
public String getValue()
public final Option withText(Text text)
text attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.text - A new value for textthis objectpublic final Option withValue(String value)
value attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for valuethis objectpublic final Option withUrl(@Nullable String value)
url attribute.value - The value for url, null is accepted as java.util.Optional.empty()this objectpublic final Option withUrl(Optional<String> optional)
url attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for urlthis objectpublic boolean equals(@Nullable Object another)
Option that have equal attribute values.public int hashCode()
text, value, url.public String toString()
Option with attribute values.public static Option of(Text text, String value)
Option instance.text - The value for the text attributevalue - The value for the value attributepublic static Option copyOf(OptionIF instance)
OptionIF value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static Option.Builder builder()
Option.Copyright © 2019. All rights reserved.