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.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 Summary
Constructors Constructor Description ImageSuffix(java.lang.String suffix, int height, int width, Image.ResolutionLevel estimatedResolutionLevel)
Create a newImageSuffix
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHeight()
Image.ResolutionLevel
getResolutionLevel()
java.lang.String
getSuffix()
int
getWidth()
java.lang.String
toString()
Get a string representation of thisImageSuffix
instance.
-
-
-
Constructor Detail
-
ImageSuffix
public ImageSuffix(@Nonnull java.lang.String suffix, int height, int width, @Nonnull Image.ResolutionLevel estimatedResolutionLevel) throws java.lang.NullPointerException
Create a newImageSuffix
instance.- Parameters:
suffix
- the suffix stringheight
- the height corresponding to the image suffixwidth
- the width corresponding to the image suffixestimatedResolutionLevel
- theImage.ResolutionLevel
of the image suffix, which must not be null- Throws:
java.lang.NullPointerException
- ifestimatedResolutionLevel
isnull
-
-
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.ResolutionLevel
of the suffix, which is never null.
-
toString
@Nonnull public java.lang.String toString()
Get a string representation of thisImageSuffix
instance.The representation will be in the following format, where
suffix
,height
,width
andresolutionLevel
represent the corresponding properties:
ImageSuffix {url=url, height=height, width=width, resolutionLevel=resolutionLevel}'
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
ImageSuffix
instance
-
-