Package de.jcm.discordgamesdk.image
Class ImageHandle
java.lang.Object
de.jcm.discordgamesdk.image.ImageHandle
Handle identifying a Discord image.
Mainly used for ImageManager
.
- See Also:
-
Constructor Summary
ConstructorDescriptionImageHandle
(ImageType type, long id, int size) Constructs a new ImageHandle. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
getId()
Gets the ID of the user to whose avatar this handle points to.int
getSize()
Gets the desired resolution of the image.getType()
Gets the type or source of the ImageHandle.int
hashCode()
void
setId
(long id) Sets the ID of the user to whose avatar this handle points to.void
setSize
(int size) Sets the desired resolution of the image.void
Sets the type or source of the ImageHandle.toString()
Generates a string representation of the handle containing all its attributes.
-
Constructor Details
-
ImageHandle
Constructs a new ImageHandle.- Parameters:
type
- Type or source of the imageid
- ID of the user to get the avatar image ofsize
- Desired resolution of the image, a power of 2 between 16 and 256- Throws:
IllegalArgumentException
- if the desired size is not allowed (s. a.)
-
-
Method Details
-
getType
Gets the type or source of the ImageHandle.- Returns:
- The type/source.
-
setType
Sets the type or source of the ImageHandle.- Parameters:
type
- New type
-
getId
public long getId()Gets the ID of the user to whose avatar this handle points to.- Returns:
- A user ID
-
setId
public void setId(long id) Sets the ID of the user to whose avatar this handle points to.- Parameters:
id
- A user ID
-
getSize
public int getSize()Gets the desired resolution of the image.- Returns:
- The desired resolution
-
setSize
public void setSize(int size) Sets the desired resolution of the image.- Parameters:
size
- The desired resolution
-
toString
Generates a string representation of the handle containing all its attributes.
This is just one of IntelliJ IDEA's default
toString()
-Methods, so don't expect anything special. -
equals
-
hashCode
public int hashCode()
-