Class Image.ImageURL

  • Enclosing class:
    Image

    public static class Image.ImageURL
    extends Image
    Class used to create the JSON for an image sourced from a URL.

    Supported options:

    • Set X position.
    • Set Y position.
    • Set width.
    • Set height.
    • Set rounding of corners.
    • Set URL from the Source image (Required)
    • Constructor Detail

      • ImageURL

        public ImageURL()
    • Method Detail

      • withPosX

        public Image.ImageURL withPosX​(int posX)
        Sets the position on the X (horizontal) axis for the image.
        The value can be both negative and positive.
        Specified by:
        withPosX in class Image
        Parameters:
        posX - The positive, horizontal position of the image.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withPosY

        public Image.ImageURL withPosY​(int posY)
        Sets the position on the Y (vertical) axis for the image.
        The value can be both negative and positive.
        Specified by:
        withPosY in class Image
        Parameters:
        posY - The positive, vertical position of the image.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withWidth

        public Image.ImageURL withWidth​(int width)
        Sets the width of the Image.

        An IllegalArgumentException may be thrown in the following case:

        • Width is less than 1 or larger than 3000.
        Specified by:
        withWidth in class Image
        Parameters:
        width - The width of the image.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withHeight

        public Image.ImageURL withHeight​(int height)
        Sets the height of the Image.

        An IllegalArgumentException may be thrown in the following case:

        • Height is less than 1 or larger than 3000.
        Specified by:
        withHeight in class Image
        Parameters:
        height - The height of the image.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withColor

        public Image.ImageURL withColor​(@NotNull
                                        @NotNull ColorObject color)
        This method cannot be used in the ImageURL image type.
        Throws an IllegalArgumentException when called.
        Specified by:
        withColor in class Image
        Parameters:
        color - The ColorObject to use.
        Returns:
        Nothing.
      • withUrl

        public Image.ImageURL withUrl​(@NotNull
                                      @NotNull java.lang.String url)
        Sets the URL to get the image from.

        An IllegalArgumentException may be thrown in the following case:

        • Url is an empty String.
        Parameters:
        url - The URL to get the image from.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withCaching

        public Image.ImageURL withCaching​(boolean cache)
        Sets whether the Fluxpoint API should cache the received image or not.
        Parameters:
        cache - Boolean to set if the Fluxpoint API should cache the received image.
        Returns:
        The ImageURL instance. Useful for chaining.
      • withRound

        public Image.ImageURL withRound​(int round)
        Set an optional rounding of the Square corners.

        An IllegalArgumentException may be thrown in the following case:

        • Round is less than 0.
        Parameters:
        round - The strength of rounding the corner.
        Returns:
        The ImageURL instance. Useful for chaining.