Class ImageHandle

java.lang.Object
de.jcm.discordgamesdk.image.ImageHandle

public class ImageHandle extends Object

Handle identifying a Discord image.

Mainly used for ImageManager.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImageHandle(ImageType type, long id, int size)
    Constructs a new ImageHandle.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    long
    Gets the ID of the user to whose avatar this handle points to.
    int
    Gets the desired resolution of the image.
    Gets the type or source of the ImageHandle.
    int
     
    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.
    Generates a string representation of the handle containing all its attributes.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ImageHandle

      public ImageHandle(ImageType type, long id, int size)
      Constructs a new ImageHandle.
      Parameters:
      type - Type or source of the image
      id - ID of the user to get the avatar image of
      size - 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

      public ImageType getType()
      Gets the type or source of the ImageHandle.
      Returns:
      The type/source.
    • setType

      public void setType(ImageType type)
      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

      public String 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.

      Overrides:
      toString in class Object
      Returns:
      A string representation of the handle
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object