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().

  • Method Details

    • getBlockId

      public Optional<String> getBlockId()
      Specified by:
      getBlockId in interface Block
      Returns:
      The value of the blockId attribute
    • getType

      public String getType()
      Specified by:
      getType in interface Block
      Specified by:
      getType in interface ImageIF
      Returns:
      The computed-at-construction value of the type attribute
    • getImageUrl

      public Optional<String> getImageUrl()
      Specified by:
      getImageUrl in interface ImageIF
      Returns:
      The value of the imageUrl attribute
    • getAltText

      public String getAltText()
      Specified by:
      getAltText in interface ImageIF
      Returns:
      The value of the altText attribute
    • getTitle

      public Optional<Text> getTitle()
      Specified by:
      getTitle in interface ImageIF
      Returns:
      The value of the title attribute
    • getSlackFile

      public Optional<SlackFileObject> getSlackFile()
      Specified by:
      getSlackFile in interface ImageIF
      Returns:
      The value of the slackFile attribute
    • withBlockId

      public final Image withBlockId(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional blockId attribute.
      Parameters:
      value - The value for blockId, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withBlockId

      public final Image withBlockId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the blockId attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for blockId
      Returns:
      A modified copy or this if not changed
    • withImageUrl

      public final Image withImageUrl(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional imageUrl attribute.
      Parameters:
      value - The value for imageUrl, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withImageUrl

      public final Image withImageUrl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the imageUrl attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for imageUrl
      Returns:
      A modified copy or this if not changed
    • withAltText

      public final Image withAltText(String value)
      Copy the current immutable object by setting a value for the altText attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for altText
      Returns:
      A modified copy or the this object
    • withTitle

      public final Image withTitle(@Nullable Text value)
      Copy the current immutable object by setting a present value for the optional title attribute.
      Parameters:
      value - The value for title, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withTitle

      public final Image withTitle(Optional<? extends Text> optional)
      Copy the current immutable object by setting an optional value for the title attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for title
      Returns:
      A modified copy or this if not changed
    • withSlackFile

      public final Image withSlackFile(@Nullable SlackFileObject value)
      Copy the current immutable object by setting a present value for the optional slackFile attribute.
      Parameters:
      value - The value for slackFile, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withSlackFile

      public final Image withSlackFile(Optional<? extends SlackFileObject> optional)
      Copy the current immutable object by setting an optional value for the slackFile attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for slackFile
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Image that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: blockId, type, imageUrl, altText, title, slackFile.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Image with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static Image of(Optional<String> imageUrl, String altText)
      Construct a new immutable Image instance.
      Parameters:
      imageUrl - The value for the imageUrl attribute
      altText - The value for the altText attribute
      Returns:
      An immutable Image instance
    • of

      public static Image of(@Nullable String imageUrl, String altText)
      Construct a new immutable Image instance.
      Parameters:
      imageUrl - The value for the imageUrl attribute
      altText - The value for the altText attribute
      Returns:
      An immutable Image instance
    • copyOf

      public static Image copyOf(ImageIF instance)
      Creates an immutable copy of a ImageIF value. 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

      public static Image.Builder builder()
      Creates a builder for Image.
       Image.builder()
          .setBlockId(Optional<String>) // optional blockId
          .setImageUrl(Optional<String>) // optional imageUrl
          .setAltText(String) // required altText
          .setTitle(Optional<com.hubspot.slack.client.models.blocks.objects.Text>) // optional title
          .setSlackFile(Optional<SlackFileObject>) // optional slackFile
          .build();
       
      Returns:
      A new Image builder