@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","TextIF"}) @Immutable public final class Text extends Object implements TextIF
TextIF.
Use the builder to create immutable instances:
Text.builder().
Use the static factory method to create immutable instances:
Text.of().
| Modifier and Type | Class and Description |
|---|---|
static class |
Text.Builder
Builds instances of type
Text. |
| Modifier and Type | Method and Description |
|---|---|
static Text.Builder |
builder()
Creates a builder for
Text. |
static Text |
copyOf(TextIF instance)
Creates an immutable copy of a
TextIF value. |
boolean |
equals(Object another)
This instance is equal to all instances of
Text that have equal attribute values. |
String |
getText() |
TextType |
getType() |
int |
hashCode()
Computes a hash code from attributes:
type, text, emoji, verbatim. |
Optional<Boolean> |
isEmoji() |
Optional<Boolean> |
isVerbatim() |
static Text |
of(TextType type,
String text)
Construct a new immutable
Text instance. |
String |
toString()
Prints the immutable value
Text with attribute values. |
Text |
withEmoji(Boolean value)
Copy the current immutable object by setting a present value for the optional
emoji attribute. |
Text |
withEmoji(Optional<Boolean> optional)
Copy the current immutable object by setting an optional value for the
emoji attribute. |
Text |
withText(String text)
Copy the current immutable object by setting a value for the
text attribute. |
Text |
withType(TextType type)
Copy the current immutable object by setting a value for the
type attribute. |
Text |
withVerbatim(Boolean value)
Copy the current immutable object by setting a present value for the optional
verbatim attribute. |
Text |
withVerbatim(Optional<Boolean> optional)
Copy the current immutable object by setting an optional value for the
verbatim attribute. |
public TextType getType()
public String getText()
public Optional<Boolean> isVerbatim()
isVerbatim in interface TextIFverbatim attributepublic final Text withType(TextType type)
type attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.type - A new value for typethis objectpublic final Text withText(String text)
text attribute.
An equals check used to prevent copying of the same value by returning this.text - A new value for textthis objectpublic final Text withEmoji(@Nullable Boolean value)
emoji attribute.value - The value for emoji, null is accepted as java.util.Optional.empty()this objectpublic final Text withEmoji(Optional<Boolean> optional)
emoji attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for emojithis objectpublic final Text withVerbatim(@Nullable Boolean value)
verbatim attribute.value - The value for verbatim, null is accepted as java.util.Optional.empty()this objectpublic final Text withVerbatim(Optional<Boolean> optional)
verbatim attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for verbatimthis objectpublic boolean equals(@Nullable Object another)
Text that have equal attribute values.public int hashCode()
type, text, emoji, verbatim.public String toString()
Text with attribute values.public static Text of(TextType type, String text)
Text instance.type - The value for the type attributetext - The value for the text attributepublic static Text copyOf(TextIF instance)
TextIF 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 Text.Builder builder()
Text.Copyright © 2019. All rights reserved.