Class Card
java.lang.Object
com.hubspot.slack.client.models.blocks.Card
- All Implemented Interfaces:
BlockOrAttachment,Block,CardIF,ChatUnfurlBlocksOrAttachment
@Generated(from="CardIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Card
extends Object
implements CardIF
Immutable implementation of
CardIF.
Use the builder to create immutable instances:
Card.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Card.Builderbuilder()Creates a builder forCard.static CardCreates an immutable copy of aCardIFvalue.booleanThis instance is equal to all instances ofCardthat have equal attribute values.com.google.common.collect.ImmutableList<BlockElement> getBody()getIcon()getTitle()getType()inthashCode()Computes a hash code from attributes:blockId,type,heroImage,icon,title,subtitle,body,subtext,actions,slackIcon.toString()Prints the immutable valueCardwith attribute values.final CardwithActions(BlockElement... elements) Copy the current immutable object with elements that replace the content ofactions.final CardwithActions(Iterable<? extends BlockElement> elements) Copy the current immutable object with elements that replace the content ofactions.final CardwithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final CardwithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final CardCopy the current immutable object by setting a present value for the optionalbodyattribute.final CardCopy the current immutable object by setting an optional value for thebodyattribute.final CardwithHeroImage(Image value) Copy the current immutable object by setting a present value for the optionalheroImageattribute.final CardwithHeroImage(Optional<? extends Image> optional) Copy the current immutable object by setting an optional value for theheroImageattribute.final CardCopy the current immutable object by setting a present value for the optionaliconattribute.final CardCopy the current immutable object by setting an optional value for theiconattribute.final CardwithSlackIcon(SlackIconObject value) Copy the current immutable object by setting a present value for the optionalslackIconattribute.final CardwithSlackIcon(Optional<? extends SlackIconObject> optional) Copy the current immutable object by setting an optional value for theslackIconattribute.final CardwithSubtext(Text value) Copy the current immutable object by setting a present value for the optionalsubtextattribute.final CardwithSubtext(Optional<? extends Text> optional) Copy the current immutable object by setting an optional value for thesubtextattribute.final CardwithSubtitle(Text value) Copy the current immutable object by setting a present value for the optionalsubtitleattribute.final CardwithSubtitle(Optional<? extends Text> optional) Copy the current immutable object by setting an optional value for thesubtitleattribute.final CardCopy the current immutable object by setting a present value for the optionaltitleattribute.final CardCopy the current immutable object by setting an optional value for thetitleattribute.
-
Method Details
-
getBlockId
- Specified by:
getBlockIdin interfaceBlock- Returns:
- The value of the
blockIdattribute
-
getType
-
getHeroImage
- Specified by:
getHeroImagein interfaceCardIF- Returns:
- The value of the
heroImageattribute
-
getIcon
-
getTitle
-
getSubtitle
- Specified by:
getSubtitlein interfaceCardIF- Returns:
- The value of the
subtitleattribute
-
getBody
-
getSubtext
- Specified by:
getSubtextin interfaceCardIF- Returns:
- The value of the
subtextattribute
-
getActions
- Specified by:
getActionsin interfaceCardIF- Returns:
- The value of the
actionsattribute
-
getSlackIcon
- Specified by:
getSlackIconin interfaceCardIF- Returns:
- The value of the
slackIconattribute
-
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
-
withHeroImage
Copy the current immutable object by setting a present value for the optionalheroImageattribute.- Parameters:
value- The value for heroImage,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withHeroImage
Copy the current immutable object by setting an optional value for theheroImageattribute. 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 heroImage- Returns:
- A modified copy or
thisif not changed
-
withIcon
Copy the current immutable object by setting a present value for the optionaliconattribute.- Parameters:
value- The value for icon,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withIcon
Copy the current immutable object by setting an optional value for theiconattribute. 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 icon- Returns:
- A modified copy or
thisif not changed
-
withTitle
Copy the current immutable object by setting a present value for the optionaltitleattribute.- Parameters:
value- The value for title,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withTitle
Copy the current immutable object by setting an optional value for thetitleattribute. 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 title- Returns:
- A modified copy or
thisif not changed
-
withSubtitle
Copy the current immutable object by setting a present value for the optionalsubtitleattribute.- Parameters:
value- The value for subtitle,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withSubtitle
Copy the current immutable object by setting an optional value for thesubtitleattribute. 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 subtitle- Returns:
- A modified copy or
thisif not changed
-
withBody
Copy the current immutable object by setting a present value for the optionalbodyattribute.- Parameters:
value- The value for body,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withBody
Copy the current immutable object by setting an optional value for thebodyattribute. 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 body- Returns:
- A modified copy or
thisif not changed
-
withSubtext
Copy the current immutable object by setting a present value for the optionalsubtextattribute.- Parameters:
value- The value for subtext,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withSubtext
Copy the current immutable object by setting an optional value for thesubtextattribute. 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 subtext- Returns:
- A modified copy or
thisif not changed
-
withActions
Copy the current immutable object with elements that replace the content ofactions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withActions
Copy the current immutable object with elements that replace the content ofactions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of actions elements to set- Returns:
- A modified copy or
thisif not changed
-
withSlackIcon
Copy the current immutable object by setting a present value for the optionalslackIconattribute.- Parameters:
value- The value for slackIcon,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withSlackIcon
Copy the current immutable object by setting an optional value for theslackIconattribute. 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 slackIcon- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofCardthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,heroImage,icon,title,subtitle,body,subtext,actions,slackIcon. -
toString
Prints the immutable valueCardwith attribute values. -
copyOf
Creates an immutable copy of aCardIFvalue. 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 Card instance
-
builder
Creates a builder forCard.Card.builder() .setBlockId(Optional<String>) // optionalblockId.setHeroImage(Optional<com.hubspot.slack.client.models.blocks.elements.Image>) // optionalheroImage.setIcon(Optional<com.hubspot.slack.client.models.blocks.elements.Image>) // optionalicon.setTitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optionaltitle.setSubtitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optionalsubtitle.setBody(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optionalbody.setSubtext(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optionalsubtext.addActions|addAllActions(com.hubspot.slack.client.models.blocks.elements.BlockElement) //actionselements .setSlackIcon(Optional<com.hubspot.slack.client.models.blocks.objects.SlackIconObject>) // optionalslackIcon.build();- Returns:
- A new Card builder
-