Class Image
java.lang.Object
com.hubspot.slack.client.models.blocks.Image
- All Implemented Interfaces:
BlockOrAttachment,Block,ContainerChildBlock,ImageIF,ImageBlockOrText,ChatUnfurlBlocksOrAttachment
@Generated(from="ImageIF",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class Image
extends Object
implements ImageIF
Immutable implementation of
ImageIF.
Use the builder to create immutable instances:
Image.builder().
Use the static factory method to create immutable instances:
Image.of().
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Image.Builderbuilder()Creates a builder forImage.static ImageCreates an immutable copy of aImageIFvalue.booleanThis instance is equal to all instances ofImagethat have equal attribute values.getTitle()getType()inthashCode()Computes a hash code from attributes:blockId,type,imageUrl,altText,title,slackFile.static ImageConstruct a new immutableImageinstance.static ImageConstruct a new immutableImageinstance.toString()Prints the immutable valueImagewith attribute values.final ImagewithAltText(String value) Copy the current immutable object by setting a value for thealtTextattribute.final ImagewithBlockId(String value) Copy the current immutable object by setting a present value for the optionalblockIdattribute.final ImagewithBlockId(Optional<String> optional) Copy the current immutable object by setting an optional value for theblockIdattribute.final ImagewithImageUrl(String value) Copy the current immutable object by setting a present value for the optionalimageUrlattribute.final ImagewithImageUrl(Optional<String> optional) Copy the current immutable object by setting an optional value for theimageUrlattribute.final ImagewithSlackFile(SlackFileObject value) Copy the current immutable object by setting a present value for the optionalslackFileattribute.final ImagewithSlackFile(Optional<? extends SlackFileObject> optional) Copy the current immutable object by setting an optional value for theslackFileattribute.final ImageCopy the current immutable object by setting a present value for the optionaltitleattribute.final ImageCopy 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
-
getImageUrl
- Specified by:
getImageUrlin interfaceImageIF- Returns:
- The value of the
imageUrlattribute
-
getAltText
- Specified by:
getAltTextin interfaceImageIF- Returns:
- The value of the
altTextattribute
-
getTitle
-
getSlackFile
- Specified by:
getSlackFilein interfaceImageIF- Returns:
- The value of the
slackFileattribute
-
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
-
withImageUrl
Copy the current immutable object by setting a present value for the optionalimageUrlattribute.- Parameters:
value- The value for imageUrl,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withImageUrl
Copy the current immutable object by setting an optional value for theimageUrlattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for imageUrl- Returns:
- A modified copy or
thisif not changed
-
withAltText
Copy the current immutable object by setting a value for thealtTextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for altText- Returns:
- A modified copy or the
thisobject
-
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
-
withSlackFile
Copy the current immutable object by setting a present value for the optionalslackFileattribute.- Parameters:
value- The value for slackFile,nullis accepted asjava.util.Optional.empty()- Returns:
- A modified copy or
thisif not changed
-
withSlackFile
Copy the current immutable object by setting an optional value for theslackFileattribute. 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 slackFile- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImagethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:blockId,type,imageUrl,altText,title,slackFile. -
toString
Prints the immutable valueImagewith attribute values. -
of
Construct a new immutableImageinstance.- Parameters:
imageUrl- The value for theimageUrlattributealtText- The value for thealtTextattribute- Returns:
- An immutable Image instance
-
of
Construct a new immutableImageinstance.- Parameters:
imageUrl- The value for theimageUrlattributealtText- The value for thealtTextattribute- Returns:
- An immutable Image instance
-
copyOf
Creates an immutable copy of aImageIFvalue. 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 Image instance
-
builder
Creates a builder forImage.Image.builder() .setBlockId(Optional<String>) // optionalblockId.setImageUrl(Optional<String>) // optionalimageUrl.setAltText(String) // requiredaltText.setTitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optionaltitle.setSlackFile(Optional<SlackFileObject>) // optionalslackFile.build();- Returns:
- A new Image builder
-