@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().
| 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. |
Optional<String> |
getText() |
String |
getValue() |
int |
hashCode()
Computes a hash code from attributes:
text, value. |
String |
toString()
Prints the immutable value
Option with attribute values. |
Option |
withText(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
text attribute. |
Option |
withText(String value)
Copy the current immutable object by setting a present value for the optional
text attribute. |
Option |
withValue(String value)
Copy the current immutable object by setting a value for the
value attribute. |
public String getValue()
public final Option withText(@Nullable String value)
text attribute.value - The value for text, null is accepted as java.util.Optional.empty()this objectpublic final Option withText(Optional<String> optional)
text attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A 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 boolean equals(@Nullable Object another)
Option that have equal attribute values.public int hashCode()
text, value.public String toString()
Option with attribute values.public 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.