Class Section
java.lang.Object
com.hubspot.slack.client.models.blocks.Section
- All Implemented Interfaces:
BlockOrAttachment,Block,ContainerChildBlock,SectionIF,ChatUnfurlBlocksOrAttachment
@Generated(from="SectionIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Section
extends Object
implements SectionIF
Immutable implementation of
SectionIF.
Use the builder to create immutable instances:
Section.builder().
Use the static factory method to create immutable instances:
Section.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Section.Builderbuilder()Creates a builder forSection.static SectionCreates an immutable copy of aSectionIFvalue.booleanThis instance is equal to all instances ofSectionthat have equal attribute values.getText()getType()inthashCode()Computes a hash code from attributes:blockId,type,text,fields,accessory.static SectionConstruct a new immutableSectioninstance.toString()Prints the immutable valueSectionwith attribute values.final SectionwithAccessory(BlockElement value) Copy the current immutable object by setting a present value for the optionalaccessoryattribute.final SectionwithAccessory(Optional<? extends BlockElement> optional) Copy the current immutable object by setting an optional value for theaccessoryattribute.final SectionwithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final SectionwithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final SectionwithFields(Text... elements) Copy the current immutable object with elements that replace the content offields.final SectionwithFields(Iterable<? extends Text> elements) Copy the current immutable object with elements that replace the content offields.final SectionCopy the current immutable object by setting a value for thetextattribute.
-
Method Details
-
getBlockId
- Specified by:
getBlockIdin interfaceBlock- Returns:
- The value of the
blockIdattribute
-
getType
-
getText
-
getFields
-
getAccessory
- Specified by:
getAccessoryin interfaceSectionIF- Returns:
- The value of the
accessoryattribute
-
withBlockId
Copy the current immutable object by setting a present value for the optionalblockIdattribute.- Parameters:
value- The value for blockId,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withBlockId
Copy the current immutable object by setting an optional value for theblockIdattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for blockId- Returns:
- A modified copy or
thisif not changed
-
withText
Copy the current immutable object by setting a value for thetextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text (can benull)- Returns:
- A modified copy or the
thisobject
-
withFields
Copy the current immutable object with elements that replace the content offields.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withFields
Copy the current immutable object with elements that replace the content offields. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of fields elements to set- Returns:
- A modified copy or
thisif not changed
-
withAccessory
Copy the current immutable object by setting a present value for the optionalaccessoryattribute.- Parameters:
value- The value for accessory,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withAccessory
Copy the current immutable object by setting an optional value for theaccessoryattribute. 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 accessory- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofSectionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,text,fields,accessory. -
toString
Prints the immutable valueSectionwith attribute values. -
of
Construct a new immutableSectioninstance.- Parameters:
text- The value for thetextattribute- Returns:
- An immutable Section instance
-
copyOf
Creates an immutable copy of aSectionIFvalue. 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 Section instance
-
builder
Creates a builder forSection.Section.builder() .setBlockId(Optional<String>) // optionalblockId.setText(com.hubspot.slack.client.models.blocks.objects.Text | null) // nullabletext.addFields|addAllFields(com.hubspot.slack.client.models.blocks.objects.Text) //fieldselements .setAccessory(Optional<com.hubspot.slack.client.models.blocks.elements.BlockElement>) // optionalaccessory.build();- Returns:
- A new Section builder
-