Class Header
java.lang.Object
com.hubspot.slack.client.models.blocks.Header
- All Implemented Interfaces:
BlockOrAttachment,Block,ContainerChildBlock,HeaderIF,ChatUnfurlBlocksOrAttachment
@Generated(from="HeaderIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Header
extends Object
implements HeaderIF
Immutable implementation of
HeaderIF.
Use the builder to create immutable instances:
Header.builder().
Use the static factory method to create immutable instances:
Header.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Header.Builderbuilder()Creates a builder forHeader.static HeaderCreates an immutable copy of aHeaderIFvalue.booleanThis instance is equal to all instances ofHeaderthat have equal attribute values.getText()getType()inthashCode()Computes a hash code from attributes:blockId,type,text.static HeaderConstruct a new immutableHeaderinstance.toString()Prints the immutable valueHeaderwith attribute values.final HeaderwithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final HeaderwithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final HeaderCopy 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
-
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- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofHeaderthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,text. -
toString
Prints the immutable valueHeaderwith attribute values. -
of
Construct a new immutableHeaderinstance.- Parameters:
text- The value for thetextattribute- Returns:
- An immutable Header instance
-
copyOf
Creates an immutable copy of aHeaderIFvalue. 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 Header instance
-
builder
Creates a builder forHeader.Header.builder() .setBlockId(Optional<String>) // optionalblockId.setText(com.hubspot.slack.client.models.blocks.objects.Text) // requiredtext.build();- Returns:
- A new Header builder
-