Class ImageSuffix

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ImageSuffix
    extends java.lang.Object
    implements java.io.Serializable
    Serializable class representing a suffix (which may include its format extension, such as .jpg) which needs to be added to get an image/thumbnail URL with its corresponding height, width and estimated resolution level.

    This class is used to construct Image instances from a single base URL/path, in order to get all or most image resolutions provided, depending of the service and the resolutions provided.

    Note that this class is not intended to be used externally and so should only be used when interfacing with the extractor.

    See Also:
    Serialized Form
    • Constructor Detail

      • ImageSuffix

        public ImageSuffix​(@Nonnull
                           java.lang.String suffix,
                           int height,
                           int width,
                           @Nonnull
                           Image.ResolutionLevel estimatedResolutionLevel)
                    throws java.lang.NullPointerException
        Create a new ImageSuffix instance.
        Parameters:
        suffix - the suffix string
        height - the height corresponding to the image suffix
        width - the width corresponding to the image suffix
        estimatedResolutionLevel - the Image.ResolutionLevel of the image suffix, which must not be null
        Throws:
        java.lang.NullPointerException - if estimatedResolutionLevel is null
    • Method Detail

      • getSuffix

        @Nonnull
        public java.lang.String getSuffix()
        Returns:
        the suffix which needs to be appended to get the full image URL
      • getHeight

        public int getHeight()
        Returns:
        the height corresponding to the image suffix, which may be unknown
      • getWidth

        public int getWidth()
        Returns:
        the width corresponding to the image suffix, which may be unknown
      • toString

        @Nonnull
        public java.lang.String toString()
        Get a string representation of this ImageSuffix instance.

        The representation will be in the following format, where suffix, height, width and resolutionLevel represent the corresponding properties:

        ImageSuffix {url=url, height=height, width=width, resolutionLevel=resolutionLevel}'

        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this ImageSuffix instance