Class RichTextTextElement
java.lang.Object
com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElement
- All Implemented Interfaces:
BlockElement,RichTextElement,RichTextTextElementIF
@Generated(from="RichTextTextElementIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class RichTextTextElement
extends Object
implements RichTextTextElementIF
Immutable implementation of
RichTextTextElementIF.
Use the builder to create immutable instances:
RichTextTextElement.builder().
Use the static factory method to create immutable instances:
RichTextTextElement.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeRichTextTextElement.static final classImmutable implementation ofRichTextTextElementIF.StyleIF.Nested classes/interfaces inherited from interface com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElementIF
RichTextTextElementIF.StyleIF -
Field Summary
Fields inherited from interface com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElementIF
TYPE -
Method Summary
Modifier and TypeMethodDescriptionstatic RichTextTextElement.Builderbuilder()Creates a builder forRichTextTextElement.static RichTextTextElementcopyOf(RichTextTextElementIF instance) Creates an immutable copy of aRichTextTextElementIFvalue.booleanThis instance is equal to all instances ofRichTextTextElementthat have equal attribute values.getStyle()getText()getType()inthashCode()Computes a hash code from attributes:type,text,style.static RichTextTextElementConstruct a new immutableRichTextTextElementinstance.toString()Prints the immutable valueRichTextTextElementwith attribute values.final RichTextTextElementCopy the current immutable object by setting a present value for the optionalstyleattribute.final RichTextTextElementwithStyle(Optional<? extends RichTextTextElementIF.StyleIF> optional) Copy the current immutable object by setting an optional value for thestyleattribute.final RichTextTextElementCopy the current immutable object by setting a value for thetextattribute.
-
Method Details
-
getType
- Specified by:
getTypein interfaceBlockElement- Specified by:
getTypein interfaceRichTextTextElementIF- Returns:
- The computed-at-construction value of the
typeattribute
-
getText
- Specified by:
getTextin interfaceRichTextTextElementIF- Returns:
- The value of the
textattribute
-
getStyle
- Specified by:
getStylein interfaceRichTextTextElementIF- Returns:
- The value of the
styleattribute
-
withText
Copy the current immutable object by setting a value for thetextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy or the
thisobject
-
withStyle
Copy the current immutable object by setting a present value for the optionalstyleattribute.- Parameters:
value- The value for style,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withStyle
public final RichTextTextElement withStyle(Optional<? extends RichTextTextElementIF.StyleIF> optional) Copy the current immutable object by setting an optional value for thestyleattribute. 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 style- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofRichTextTextElementthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,text,style. -
toString
Prints the immutable valueRichTextTextElementwith attribute values. -
of
Construct a new immutableRichTextTextElementinstance.- Parameters:
text- The value for thetextattribute- Returns:
- An immutable RichTextTextElement instance
-
copyOf
Creates an immutable copy of aRichTextTextElementIFvalue. 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 RichTextTextElement instance
-
builder
Creates a builder forRichTextTextElement.RichTextTextElement.builder() .setText(String) // requiredtext.setStyle(Optional<com.hubspot.slack.client.models.blocks.elements.richtextelements.RichTextTextElementIF.StyleIF>) // optionalstyle.build();- Returns:
- A new RichTextTextElement builder
-