Package discord4j.rest.util
Class Image
- java.lang.Object
-
- discord4j.rest.util.Image
-
public final class Image extends Object
Represents a Discord image.- See Also:
- Image Formatting
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImage.FormatThe format of an image.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)byte[]getData()Gets the raw data of the image.StringgetDataUri()Gets a data URI for this image.Image.FormatgetFormat()Gets the format of the image.StringgetHash()Gets the Base64-encoded data of the image.inthashCode()static ImageofRaw(byte[] data, Image.Format format)Constructs anImageutilizing raw image data.static Mono<Image>ofUrl(String url)Constructs anImageusing the resource at the given url.StringtoString()
-
-
-
Method Detail
-
ofRaw
public static Image ofRaw(byte[] data, Image.Format format)
Constructs anImageutilizing raw image data.- Parameters:
data- The raw image data.format- TheImage.Formatof the data.- Returns:
- An
Imagewith raw image data.
-
ofUrl
public static Mono<Image> ofUrl(String url)
Constructs anImageusing the resource at the given url.
-
getData
public byte[] getData()
Gets the raw data of the image.- Returns:
- The raw data of the image.
-
getFormat
public Image.Format getFormat()
Gets the format of the image.- Returns:
- The format of the image.
-
getHash
public String getHash()
Gets the Base64-encoded data of the image.- Returns:
- The Base64-encoded data of the image.
-
getDataUri
public String getDataUri()
Gets a data URI for this image.- Returns:
- The data URI for this image.
-
-