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 class
Image.Format
The format of an image.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
byte[]
getData()
Gets the raw data of the image.String
getDataUri()
Gets a data URI for this image.Image.Format
getFormat()
Gets the format of the image.String
getHash()
Gets the Base64-encoded data of the image.int
hashCode()
static Image
ofRaw(byte[] data, Image.Format format)
Constructs anImage
utilizing raw image data.static Mono<Image>
ofUrl(String url)
Constructs anImage
using the resource at the given url.String
toString()
-
-
-
Method Detail
-
ofRaw
public static Image ofRaw(byte[] data, Image.Format format)
Constructs anImage
utilizing raw image data.- Parameters:
data
- The raw image data.format
- TheImage.Format
of the data.- Returns:
- An
Image
with raw image data.
-
ofUrl
public static Mono<Image> ofUrl(String url)
Constructs anImage
using 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.
-
-