Class SectionImpl
java.lang.Object
net.dv8tion.jda.internal.components.AbstractComponentImpl
net.dv8tion.jda.internal.components.section.SectionImpl
- All Implemented Interfaces:
IDisableable
,Component
,ContainerChildComponent
,ContainerChildComponentUnion
,IComponentUnion
,MessageTopLevelComponent
,MessageTopLevelComponentUnion
,IReplaceable
,Section
,SerializableData
public class SectionImpl
extends AbstractComponentImpl
implements Section, MessageTopLevelComponentUnion, ContainerChildComponentUnion
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.components.Component
Component.Type
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.components.section.Section
MAX_COMPONENTS
-
Constructor Summary
ConstructorsConstructorDescriptionSectionImpl
(int uniqueId, Collection<SectionContentComponentUnion> components, SectionAccessoryComponentUnion accessory) SectionImpl
(Collection<SectionContentComponentUnion> components, SectionAccessoryComponentUnion accessory) SectionImpl
(DataObject data) -
Method Summary
Modifier and TypeMethodDescriptionboolean
The accessory of this section.@Unmodifiable List
<SectionContentComponentUnion> Returns an immutable list with the components contained by this section.getType()
The type of component.int
The unique, numeric identifier of this component.int
hashCode()
static Section
of
(SectionAccessoryComponent accessory, Collection<? extends SectionContentComponent> components) replace
(ComponentReplacer replacer) Replaces and/or removes children components using the providedComponentReplacer
, and construct a new component from the result.toData()
SerializedDataObject
for this object.toString()
withUniqueId
(int uniqueId) Creates a new component with the provided numeric ID.Methods inherited from class net.dv8tion.jda.internal.components.AbstractComponentImpl
asActionRow, asButton, asContainer, asEntitySelectMenu, asFileDisplay, asMediaGallery, asSection, asSeparator, asStringSelectMenu, asTextDisplay, asTextInput, asThumbnail
Methods inherited from interface net.dv8tion.jda.api.components.container.ContainerChildComponentUnion
asActionRow, asFileDisplay, asMediaGallery, asSection, asSeparator, asTextDisplay
Methods inherited from interface net.dv8tion.jda.api.components.IComponentUnion
isUnknownComponent
Methods inherited from interface net.dv8tion.jda.api.components.MessageTopLevelComponentUnion
asActionRow, asContainer, asFileDisplay, asMediaGallery, asSection, asSeparator, asTextDisplay
Methods inherited from interface net.dv8tion.jda.api.components.section.Section
asDisabled, asEnabled, isDisabled, isEnabled, isMessageCompatible, isModalCompatible, withDisabled
-
Constructor Details
-
SectionImpl
-
SectionImpl
public SectionImpl(Collection<SectionContentComponentUnion> components, SectionAccessoryComponentUnion accessory) -
SectionImpl
public SectionImpl(int uniqueId, Collection<SectionContentComponentUnion> components, SectionAccessoryComponentUnion accessory)
-
-
Method Details
-
of
public static Section of(SectionAccessoryComponent accessory, Collection<? extends SectionContentComponent> components) -
getType
Description copied from interface:Component
The type of component.- Specified by:
getType
in interfaceComponent
- Returns:
Component.Type
-
withUniqueId
Description copied from interface:Component
Creates a new component with the provided numeric ID.
If no ID is set, Discord will generate IDs incrementally starting from 1 and will not use existing IDs from the same message/modal.- Specified by:
withUniqueId
in interfaceComponent
- Specified by:
withUniqueId
in interfaceContainerChildComponent
- Specified by:
withUniqueId
in interfaceContainerChildComponentUnion
- Specified by:
withUniqueId
in interfaceIComponentUnion
- Specified by:
withUniqueId
in interfaceIDisableable
- Specified by:
withUniqueId
in interfaceMessageTopLevelComponent
- Specified by:
withUniqueId
in interfaceMessageTopLevelComponentUnion
- Specified by:
withUniqueId
in interfaceSection
- Parameters:
uniqueId
- The new ID; must be higher or equal to 1- Returns:
- The new component
-
replace
Description copied from interface:IReplaceable
Replaces and/or removes children components using the providedComponentReplacer
, and construct a new component from the result.- Specified by:
replace
in interfaceIReplaceable
- Specified by:
replace
in interfaceSection
- Parameters:
replacer
- TheComponentReplacer
to apply- Returns:
- The new, updated component
- See Also:
-
getUniqueId
public int getUniqueId()Description copied from interface:Component
The unique, numeric identifier of this component.
Can be set manually or automatically assigned by Discord (starting from1
). If it has not been assigned yet, this will return-1
.Note: Older messages may return
0
.- Specified by:
getUniqueId
in interfaceComponent
- Returns:
- The unique identifier of this component, or
-1
if not assigned yet, or0
on older messages
-
getContentComponents
Description copied from interface:Section
Returns an immutable list with the components contained by this section.- Specified by:
getContentComponents
in interfaceSection
- Returns:
List
ofSectionContentComponentUnion
in this section
-
getAccessory
Description copied from interface:Section
The accessory of this section.- Specified by:
getAccessory
in interfaceSection
- Returns:
- Accessory of this section
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
equals
-
hashCode
public int hashCode() -
toString
-