Class ImageSuffix
- java.lang.Object
-
- org.schabi.newpipe.extractor.utils.ImageSuffix
-
- All Implemented Interfaces:
java.io.Serializable
public final class ImageSuffix extends java.lang.Object implements java.io.SerializableSerializable 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
Imageinstances 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 Summary
Constructors Constructor Description ImageSuffix(java.lang.String suffix, int height, int width, Image.ResolutionLevel estimatedResolutionLevel)Create a newImageSuffixinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHeight()Image.ResolutionLevelgetResolutionLevel()java.lang.StringgetSuffix()intgetWidth()java.lang.StringtoString()Get a string representation of thisImageSuffixinstance.
-
-
-
Constructor Detail
-
ImageSuffix
public ImageSuffix(@Nonnull java.lang.String suffix, int height, int width, @Nonnull Image.ResolutionLevel estimatedResolutionLevel) throws java.lang.NullPointerExceptionCreate 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:
java.lang.NullPointerException- ifestimatedResolutionLevelisnull
-
-
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
-
getResolutionLevel
@Nonnull public Image.ResolutionLevel getResolutionLevel()
- Returns:
- the estimated
Image.ResolutionLevelof the suffix, which is never null.
-
toString
@Nonnull public java.lang.String 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 classjava.lang.Object- Returns:
- a string representation of this
ImageSuffixinstance
-
-