java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.Image
All Implemented Interfaces:
IElement, IImage, Serializable

public class Image extends Element implements IImage
The image model represents a image node that needs to be displayed in the document or page.
Since:
6.0
Author:
Jon van Leuven
See Also:
  • Constructor Details

    • Image

      public Image(String name, byte[] imageData, ImageType imageType, ImageContentType imageContentType, String qrCodeContent)
    • Image

      public Image(ImageDefinition imageDefinition)
      Construct an image model.
      Parameters:
      imageDefinition - The definition of the image (required)
    • Image

      protected Image(Image other)
  • Method Details

    • getImageDataIdentifier

      public String getImageDataIdentifier()
      Description copied from interface: IImage
      Returns an identifier based on the image data, two images with the same data will always have the same identifier.

      The identifier can be used to identify dynamic image based on their content rather than based on its name, as multiple dynamic images may share the same name, but have different content.

      Specified by:
      getImageDataIdentifier in interface IImage
      Returns:
      the identifier of the image data
    • isDynamic

      public boolean isDynamic()
      Description copied from interface: IImage
      Indicates whether this image is dynamic.

      If an image is not dynamic, then all images with the same name will have the same image content. If an image is dynamic, then two images with the same name are not guaranteed to have the same image content, as the image content may have been generated based on a dynamic value (e.g. a QR code).

      Specified by:
      isDynamic in interface IImage
      Returns:
      true if this image is dynamic, false otherwise.
    • setName

      public void setName(String name)
    • getImageData

      public byte[] getImageData()
      This method returns the image data.
      Specified by:
      getImageData in interface IImage
      Returns:
      byte array containing raw image data.
    • getImageType

      public ImageType getImageType()
      This method returns the image type.
      Specified by:
      getImageType in interface IImage
      Returns:
      ImageType
    • getImageContentType

      public ImageContentType getImageContentType()
      Description copied from interface: IImage
      This method returns the image content type.
      Specified by:
      getImageContentType in interface IImage
      Returns:
      the image's content type
    • getQRCodeContent

      public String getQRCodeContent()
      Description copied from interface: IImage
      THis method returns the QR Code content.
      Specified by:
      getQRCodeContent in interface IImage
      Returns:
      the image's QR Code content
    • getWidth

      public IntegerValue getWidth()
      This method returns the width of the image.
      Specified by:
      getWidth in interface IImage
      Returns:
      Width of the image, null if none specified.
    • getHeight

      public IntegerValue getHeight()
      This method returns the height of the image.
      Specified by:
      getHeight in interface IImage
      Returns:
      height of the image, null if none specified.
    • setWidth

      public void setWidth(IntegerValue width)
      This method sets the width for this image model.
      Parameters:
      width - The width of the image.
    • setHeight

      public void setHeight(IntegerValue height)
      This method sets the height for this image model.
      Parameters:
      height - The height of the image.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Element
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Element
    • duplicate

      public Element duplicate()
      Description copied from interface: IElement
      This method should clone the element and return the cloned element. The duplicate method should usually make a deep copy of the element, with the exception of members that are not mutable (and thus can safely be shared between multiple copies). The properties of an element are considered to be non-mutable, and will thus by default be copied.
      Specified by:
      duplicate in interface IElement
      Returns:
      The cloned (duplicate) element.