Interface EmbedBuilderDelegate


  • public interface EmbedBuilderDelegate
    This class is internally used by the EmbedBuilder to created embeds. You usually don't want to interact with this object.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addField​(java.lang.String name, java.lang.String value, boolean inline)
      Adds a field to the embed.
      void removeFields​(java.util.function.Predicate<EmbedField> predicate)
      Removes all fields of the embed that satisfy the given predicate.
      boolean requiresAttachments()
      Checks if this embed requires any attachments.
      void setAuthor​(java.lang.String name)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, byte[] icon)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, byte[] icon, java.lang.String fileType)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.awt.image.BufferedImage icon)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.awt.image.BufferedImage icon, java.lang.String fileType)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.io.File icon)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.io.InputStream icon)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.io.InputStream icon, java.lang.String fileType)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, java.lang.String iconUrl)
      Sets the author of the embed.
      void setAuthor​(java.lang.String name, java.lang.String url, Icon icon)
      Sets the author of the embed.
      void setAuthor​(MessageAuthor author)
      Sets the author of the embed.
      void setAuthor​(User author)
      Sets the author of the embed.
      void setColor​(java.awt.Color color)
      Sets the color of the embed.
      void setDescription​(java.lang.String description)
      Sets the description of the embed.
      void setFooter​(java.lang.String text)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, byte[] icon)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, byte[] icon, java.lang.String fileType)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.awt.image.BufferedImage icon)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.awt.image.BufferedImage icon, java.lang.String fileType)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.io.File icon)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.io.InputStream icon)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.io.InputStream icon, java.lang.String fileType)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, java.lang.String iconUrl)
      Sets the footer of the embed.
      void setFooter​(java.lang.String text, Icon icon)
      Sets the footer of the embed.
      void setImage​(byte[] image)
      Sets the image of the embed.
      void setImage​(byte[] image, java.lang.String fileType)
      Sets the image of the embed.
      void setImage​(java.awt.image.BufferedImage image)
      Sets the image of the embed.
      void setImage​(java.awt.image.BufferedImage image, java.lang.String fileType)
      Sets the image of the embed.
      void setImage​(java.io.File image)
      Sets the image of the embed.
      void setImage​(java.io.InputStream image)
      Sets the image of the embed.
      void setImage​(java.io.InputStream image, java.lang.String fileType)
      Sets the image of the embed.
      void setImage​(java.lang.String url)
      Sets the image of the embed.
      void setImage​(Icon image)
      Sets the image of the embed.
      void setThumbnail​(byte[] thumbnail)
      Sets the thumbnail of the embed.
      void setThumbnail​(byte[] thumbnail, java.lang.String fileType)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.awt.image.BufferedImage thumbnail)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.awt.image.BufferedImage thumbnail, java.lang.String fileType)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.io.File thumbnail)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.io.InputStream thumbnail)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.io.InputStream thumbnail, java.lang.String fileType)
      Sets the thumbnail of the embed.
      void setThumbnail​(java.lang.String url)
      Sets the thumbnail of the embed.
      void setThumbnail​(Icon thumbnail)
      Sets the thumbnail of the embed.
      void setTimestamp​(java.time.Instant timestamp)
      Sets the timestamp of the embed.
      void setTimestampToNow()
      Sets the current time as timestamp of the embed.
      void setTitle​(java.lang.String title)
      Sets the title of the embed.
      void setUrl​(java.lang.String url)
      Sets the url of the embed.
      void updateFields​(java.util.function.Predicate<EmbedField> predicate, java.util.function.Consumer<EditableEmbedField> updater)
      Updates all fields of the embed that satisfy the given predicate using the given updater.
    • Method Detail

      • setTitle

        void setTitle​(java.lang.String title)
        Sets the title of the embed.
        Parameters:
        title - The title of the embed.
      • setDescription

        void setDescription​(java.lang.String description)
        Sets the description of the embed.
        Parameters:
        description - The description of the embed.
      • setUrl

        void setUrl​(java.lang.String url)
        Sets the url of the embed.
        Parameters:
        url - The url of the embed.
      • setTimestampToNow

        void setTimestampToNow()
        Sets the current time as timestamp of the embed.
      • setTimestamp

        void setTimestamp​(java.time.Instant timestamp)
        Sets the timestamp of the embed.
        Parameters:
        timestamp - The timestamp to set.
      • setColor

        void setColor​(java.awt.Color color)
        Sets the color of the embed.
        Parameters:
        color - The color of the embed.
      • setFooter

        void setFooter​(java.lang.String text)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
      • setFooter

        void setFooter​(java.lang.String text,
                       java.lang.String iconUrl)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        iconUrl - The url of the footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       Icon icon)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       java.io.File icon)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       java.io.InputStream icon)
        Sets the footer of the embed. This method assumes the file type is "png"!
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       java.io.InputStream icon,
                       java.lang.String fileType)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setFooter

        void setFooter​(java.lang.String text,
                       byte[] icon)
        Sets the footer of the embed. This method assumes the file type is "png"!
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       byte[] icon,
                       java.lang.String fileType)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setFooter

        void setFooter​(java.lang.String text,
                       java.awt.image.BufferedImage icon)
        Sets the footer of the embed. This method assumes the file type is "png"!
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
      • setFooter

        void setFooter​(java.lang.String text,
                       java.awt.image.BufferedImage icon,
                       java.lang.String fileType)
        Sets the footer of the embed.
        Parameters:
        text - The text of the footer.
        icon - The footer's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setImage

        void setImage​(java.lang.String url)
        Sets the image of the embed.
        Parameters:
        url - The url of the image.
      • setImage

        void setImage​(Icon image)
        Sets the image of the embed.
        Parameters:
        image - The image.
      • setImage

        void setImage​(java.io.File image)
        Sets the image of the embed.
        Parameters:
        image - The image.
      • setImage

        void setImage​(java.io.InputStream image)
        Sets the image of the embed. This method assumes the file type is "png"!
        Parameters:
        image - The image.
      • setImage

        void setImage​(java.io.InputStream image,
                      java.lang.String fileType)
        Sets the image of the embed.
        Parameters:
        image - The image.
        fileType - The type of the file, e.g. "png" or "gif".
      • setImage

        void setImage​(byte[] image)
        Sets the image of the embed. This method assumes the file type is "png"!
        Parameters:
        image - The image.
      • setImage

        void setImage​(byte[] image,
                      java.lang.String fileType)
        Sets the image of the embed.
        Parameters:
        image - The image.
        fileType - The type of the file, e.g. "png" or "gif".
      • setImage

        void setImage​(java.awt.image.BufferedImage image)
        Sets the image of the embed. This method assumes the file type is "png"!
        Parameters:
        image - The image.
      • setImage

        void setImage​(java.awt.image.BufferedImage image,
                      java.lang.String fileType)
        Sets the image of the embed.
        Parameters:
        image - The image.
        fileType - The type of the file, e.g. "png" or "gif".
      • setAuthor

        void setAuthor​(MessageAuthor author)
        Sets the author of the embed.
        Parameters:
        author - The message author which should be used as author.
      • setAuthor

        void setAuthor​(User author)
        Sets the author of the embed.
        Parameters:
        author - The user which should be used as author.
      • setAuthor

        void setAuthor​(java.lang.String name)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.lang.String iconUrl)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        iconUrl - The url of the author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       Icon icon)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.io.File icon)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.io.InputStream icon)
        Sets the author of the embed. This method assumes the file type is "png"!
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.io.InputStream icon,
                       java.lang.String fileType)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       byte[] icon)
        Sets the author of the embed. This method assumes the file type is "png"!
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       byte[] icon,
                       java.lang.String fileType)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.awt.image.BufferedImage icon)
        Sets the author of the embed. This method assumes the file type is "png"!
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
      • setAuthor

        void setAuthor​(java.lang.String name,
                       java.lang.String url,
                       java.awt.image.BufferedImage icon,
                       java.lang.String fileType)
        Sets the author of the embed.
        Parameters:
        name - The name of the author.
        url - The url of the author.
        icon - The author's icon.
        fileType - The type of the file, e.g. "png" or "gif".
      • setThumbnail

        void setThumbnail​(java.lang.String url)
        Sets the thumbnail of the embed.
        Parameters:
        url - The url of the thumbnail.
      • setThumbnail

        void setThumbnail​(Icon thumbnail)
        Sets the thumbnail of the embed.
        Parameters:
        thumbnail - The thumbnail.
      • setThumbnail

        void setThumbnail​(java.io.File thumbnail)
        Sets the thumbnail of the embed.
        Parameters:
        thumbnail - The thumbnail.
      • setThumbnail

        void setThumbnail​(java.io.InputStream thumbnail)
        Sets the thumbnail of the embed. This method assumes the file type is "png"!
        Parameters:
        thumbnail - The thumbnail.
      • setThumbnail

        void setThumbnail​(java.io.InputStream thumbnail,
                          java.lang.String fileType)
        Sets the thumbnail of the embed.
        Parameters:
        thumbnail - The thumbnail.
        fileType - The type of the file, e.g. "png" or "gif".
      • setThumbnail

        void setThumbnail​(byte[] thumbnail)
        Sets the thumbnail of the embed. This method assumes the file type is "png"!
        Parameters:
        thumbnail - The thumbnail.
      • setThumbnail

        void setThumbnail​(byte[] thumbnail,
                          java.lang.String fileType)
        Sets the thumbnail of the embed.
        Parameters:
        thumbnail - The thumbnail.
        fileType - The type of the file, e.g. "png" or "gif".
      • setThumbnail

        void setThumbnail​(java.awt.image.BufferedImage thumbnail)
        Sets the thumbnail of the embed. This method assumes the file type is "png"!
        Parameters:
        thumbnail - The thumbnail.
      • setThumbnail

        void setThumbnail​(java.awt.image.BufferedImage thumbnail,
                          java.lang.String fileType)
        Sets the thumbnail of the embed.
        Parameters:
        thumbnail - The thumbnail.
        fileType - The type of the file, e.g. "png" or "gif".
      • addField

        void addField​(java.lang.String name,
                      java.lang.String value,
                      boolean inline)
        Adds a field to the embed.
        Parameters:
        name - The name of the field.
        value - The value of the field.
        inline - Whether the field should be inline or not.
      • updateFields

        void updateFields​(java.util.function.Predicate<EmbedField> predicate,
                          java.util.function.Consumer<EditableEmbedField> updater)
        Updates all fields of the embed that satisfy the given predicate using the given updater.
        Parameters:
        predicate - The predicate that fields have to satisfy to get updated.
        updater - The updater for the fields; the EditableEmbedField is only valid during the run of the updater; any try to save it in a variable and reuse it later after this method call will fail with exceptions.
      • removeFields

        void removeFields​(java.util.function.Predicate<EmbedField> predicate)
        Removes all fields of the embed that satisfy the given predicate.
        Parameters:
        predicate - The predicate that fields have to satisfy to get removed.
      • requiresAttachments

        boolean requiresAttachments()
        Checks if this embed requires any attachments.
        Returns:
        Whether the embed requires attachments or not.