Class ButtonImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      ButtonImpl​(com.fasterxml.jackson.databind.JsonNode data)
      Creates a new button.
      ButtonImpl​(ButtonStyle style, java.lang.String label, java.lang.String customId, java.lang.String url, java.lang.Boolean disabled, Emoji emoji)
      Creates a new button.
    • Constructor Detail

      • ButtonImpl

        public ButtonImpl​(com.fasterxml.jackson.databind.JsonNode data)
        Creates a new button.
        Parameters:
        data - The json data of the button.
      • ButtonImpl

        public ButtonImpl​(ButtonStyle style,
                          java.lang.String label,
                          java.lang.String customId,
                          java.lang.String url,
                          java.lang.Boolean disabled,
                          Emoji emoji)
        Creates a new button.
        Parameters:
        style - The button's style.
        label - The button's label.
        customId - The button's custom ID.
        url - The button's url.
        disabled - Whether the button is disabled.
        emoji - The button's emoji.
    • Method Detail

      • getCustomId

        public java.util.Optional<java.lang.String> getCustomId()
        Specified by:
        getCustomId in interface Button
      • getLabel

        public java.util.Optional<java.lang.String> getLabel()
        Specified by:
        getLabel in interface Button
      • getUrl

        public java.util.Optional<java.lang.String> getUrl()
        Specified by:
        getUrl in interface Button
      • isDisabled

        public java.util.Optional<java.lang.Boolean> isDisabled()
        Specified by:
        isDisabled in interface Button
      • getEmoji

        public java.util.Optional<Emoji> getEmoji()
        Specified by:
        getEmoji in interface Button
      • toJsonNode

        public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode()
        Description copied from class: ComponentImpl
        Gets the Component as a ObjectNode. This is what is sent to Discord.
        Specified by:
        toJsonNode in class ComponentImpl
        Returns:
        The component as a ObjectNode.
      • toJsonNode

        public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode​(com.fasterxml.jackson.databind.node.ObjectNode object)
        Gets the button as a ObjectNode. This is what is sent to Discord.
        Parameters:
        object - The object, the data should be added to.
        Returns:
        The button as a ObjectNode.