Class Image

    • Constructor Detail

      • Image

        public Image()
        Creates a new empty image.
      • Image

        public Image​(String src,
                     String alt)
        Creates an image with the given URL and an alternative text.

        The alternative text given to constructor is always set even if it is the default empty string which is not retained with setAlt(String).

        Parameters:
        src - the image URL
        alt - the alternate text
        See Also:
        setSrc(String), setAlt(String)
    • Method Detail

      • getSrc

        public String getSrc()
        Gets the image URL.
        Returns:
        the image URL
      • setSrc

        public void setSrc​(String src)
        Sets the image URL.
        Parameters:
        src - the image URL
      • setAlt

        public void setAlt​(String alt)
        Sets the alternate text for the image.
        Parameters:
        alt - the alternate text
      • getAlt

        public Optional<String> getAlt()
        Gets the alternate text for the image.
        Returns:
        an optional alternate text, or an empty optional if no alternate text has been set