Class ButtonImpl
- java.lang.Object
-
- org.javacord.core.entity.message.component.ComponentImpl
-
- org.javacord.core.entity.message.component.ButtonImpl
-
- All Implemented Interfaces:
Button
,Component
,LowLevelComponent
,Specializable<LowLevelComponent>
public class ButtonImpl extends ComponentImpl implements Button
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getCustomId()
java.util.Optional<Emoji>
getEmoji()
java.util.Optional<java.lang.String>
getLabel()
ButtonStyle
getStyle()
java.util.Optional<java.lang.String>
getUrl()
java.util.Optional<java.lang.Boolean>
isDisabled()
com.fasterxml.jackson.databind.node.ObjectNode
toJsonNode()
Gets the Component as aObjectNode
.com.fasterxml.jackson.databind.node.ObjectNode
toJsonNode(com.fasterxml.jackson.databind.node.ObjectNode object)
Gets the button as aObjectNode
.-
Methods inherited from class org.javacord.core.entity.message.component.ComponentImpl
getType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.message.component.LowLevelComponent
asButton, asSelectMenu, asTextInput, isButton, isSelectMenu, isTextInput
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
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
-
getStyle
public ButtonStyle getStyle()
-
getCustomId
public java.util.Optional<java.lang.String> getCustomId()
- Specified by:
getCustomId
in interfaceButton
-
getLabel
public java.util.Optional<java.lang.String> getLabel()
-
getUrl
public java.util.Optional<java.lang.String> getUrl()
-
isDisabled
public java.util.Optional<java.lang.Boolean> isDisabled()
- Specified by:
isDisabled
in interfaceButton
-
toJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode toJsonNode()
Description copied from class:ComponentImpl
Gets the Component as aObjectNode
. This is what is sent to Discord.- Specified by:
toJsonNode
in classComponentImpl
- 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 aObjectNode
. This is what is sent to Discord.- Parameters:
object
- The object, the data should be added to.- Returns:
- The button as a ObjectNode.
-
-