Class ActionRow
java.lang.Object
net.dv8tion.jda.api.interactions.components.ActionRow
- All Implemented Interfaces:
Iterable<ActionComponent>
,Component
,LayoutComponent
,SerializableData
One row of interactive message components.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.interactions.components.Component
Component.Type
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static ActionRow
fromData
(DataObject data) Load ActionRow from serialized representation.Immutable list of buttons in this ActionRow.Mutable list of components in this ActionRow.getType()
The type of component.int
hashCode()
iterator()
static ActionRow
of
(Collection<? extends ActionComponent> components) Create one row of interactive messageaction components
.static ActionRow
of
(ActionComponent... components) Create one row of interactive messageaction components
.toData()
SerializedDataObject
for this object.toString()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface net.dv8tion.jda.api.interactions.components.LayoutComponent
isEmpty, isValid, updateComponent
-
Method Details
-
fromData
Load ActionRow from serialized representation.
Inverse oftoData()
.- Parameters:
data
- Serialized version of an action row- Returns:
- ActionRow instance
- Throws:
ParsingException
- If the provided data is not a valid action rowIllegalArgumentException
- If the data is null or the type is not 1
-
of
Create one row of interactive messageaction components
.
You cannot currently mix different types of components and each type has its own maximum defined byComponent.Type.getMaxPerRow()
.- Parameters:
components
- The components for this action row- Returns:
- The action row
- Throws:
IllegalArgumentException
- If anything is null, empty, or an invalid number of components are provided
-
of
Create one row of interactive messageaction components
.
You cannot currently mix different types of components and each type has its own maximum defined byComponent.Type.getMaxPerRow()
.- Parameters:
components
- The components for this action row- Returns:
- The action row
- Throws:
IllegalArgumentException
- If anything is null, empty, or an invalid number of components are provided
-
getComponents
Mutable list of components in this ActionRow.
ActionRows should not be empty and are limited to 5 buttons.- Specified by:
getComponents
in interfaceLayoutComponent
- Returns:
- The list of components
-
getButtons
Immutable list of buttons in this ActionRow.- Specified by:
getButtons
in interfaceLayoutComponent
- Returns:
- Immutable list of buttons
-
getType
Description copied from interface:Component
The type of component.- Specified by:
getType
in interfaceComponent
- Returns:
Component.Type
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
iterator
- Specified by:
iterator
in interfaceIterable<ActionComponent>
-
toString
-
hashCode
public int hashCode() -
equals
-