Class ResolvedMediaImpl

java.lang.Object
net.dv8tion.jda.internal.components.ResolvedMediaImpl
All Implemented Interfaces:
ResolvedMedia

public class ResolvedMediaImpl extends Object implements ResolvedMedia
  • Constructor Details

    • ResolvedMediaImpl

      public ResolvedMediaImpl(DataObject data)
    • ResolvedMediaImpl

      public ResolvedMediaImpl(String attachmentId, String url, String proxyUrl, int width, int height, String contentType)
  • Method Details

    • getAttachmentId

      @Nullable public String getAttachmentId()
      Description copied from interface: ResolvedMedia
      The ID of the attachment represented by this resolved media, may return null if this media was created from an external link.
      Specified by:
      getAttachmentId in interface ResolvedMedia
      Returns:
      The ID of the attachment, or null
    • getUrl

      @Nonnull public String getUrl()
      Description copied from interface: ResolvedMedia
      The URL of this media, for locally-uploaded files, this will always be a URL from Discord's CDN, in other cases it may be an external URL.

      If you want to download the file, you should use ResolvedMedia.getProxy().

      Specified by:
      getUrl in interface ResolvedMedia
      Returns:
      The URL of this media
    • getProxyUrl

      @Nonnull public String getProxyUrl()
      Description copied from interface: ResolvedMedia
      The URL of this media, proxied by Discord's CDN.

      This URL may be invalid if the media failed to load.

      If you want to download the file, you should use ResolvedMedia.getProxy().

      Specified by:
      getProxyUrl in interface ResolvedMedia
      Returns:
      The proxy URL of this media
    • getProxy

      @Nonnull public AttachmentProxy getProxy()
      Description copied from interface: ResolvedMedia
      An AttachmentProxy for this media.
      This allows you to easily download the media.

      This proxy may not be usable if the media failed to load.

      Specified by:
      getProxy in interface ResolvedMedia
      Returns:
      The AttachmentProxy of this media
    • getWidth

      public int getWidth()
      Description copied from interface: ResolvedMedia
      The width of this media, if available, or 0.

      This may be 0 if the media failed to load.

      Specified by:
      getWidth in interface ResolvedMedia
      Returns:
      Width of this media, or 0
    • getHeight

      public int getHeight()
      Description copied from interface: ResolvedMedia
      The height of this media, if available, or 0.

      This may be 0 if the media failed to load.

      Specified by:
      getHeight in interface ResolvedMedia
      Returns:
      Height of this media, or 0
    • getContentType

      @Nullable public String getContentType()
      Description copied from interface: ResolvedMedia
      The media type, if available, or null.

      This may be absent if the media failed to load.

      Specified by:
      getContentType in interface ResolvedMedia
      Returns:
      The media type, or null
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object