Class ImageSuffix
java.lang.Object
org.schabi.newpipe.extractor.utils.ImageSuffix
- All Implemented Interfaces:
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 on 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:
-
Constructor Summary
ConstructorsConstructorDescriptionImageSuffix(String suffix, int height, int width, Image.ResolutionLevel estimatedResolutionLevel) Create a newImageSuffixinstance. -
Method Summary
Modifier and TypeMethodDescriptionintintgetWidth()toString()Get a string representation of thisImageSuffixinstance.
-
Constructor Details
-
ImageSuffix
public ImageSuffix(@Nonnull String suffix, int height, int width, @Nonnull Image.ResolutionLevel estimatedResolutionLevel) throws NullPointerException Create a newImageSuffixinstance.- Parameters:
suffix- the suffix stringheight- the height corresponding to the image suffixwidth- the width corresponding to the image suffixestimatedResolutionLevel- theImage.ResolutionLevelof the image suffix, which must not be null- Throws:
NullPointerException- ifestimatedResolutionLevelisnull
-
-
Method Details
-
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
-
getResolutionLevel
- Returns:
- the estimated
Image.ResolutionLevelof the suffix, which is never null.
-
toString
Get a string representation of thisImageSuffixinstance.The representation will be in the following format, where
suffix,height,widthandresolutionLevelrepresent the corresponding properties:
ImageSuffix {url=url, height=height, width=width, resolutionLevel=resolutionLevel}'- Overrides:
toStringin classObject- Returns:
- a string representation of this
ImageSuffixinstance
-