Class AbstractSequencedContainer<E extends Component, R extends AbstractSequencedContainer<E,R> >
java.lang.Object
io.github.kaktushose.jdac.components.internal.AbstractSequencedContainer<E,R>
- All Implemented Interfaces:
LocalizedComponent, SequencedComponent<E>, IDisableable, Component, Container, IComponentUnion, MessageTopLevelComponent, MessageTopLevelComponentUnion, IReplaceable, SerializableData
- Direct Known Subclasses:
SeparatedContainer, SequencedContainer, TextDisplayContainer
public abstract sealed class AbstractSequencedContainer<E extends Component, R extends AbstractSequencedContainer<E,R>>
extends Object
implements LocalizedComponent, SequencedComponent<E>, Container, MessageTopLevelComponentUnion, SerializableData
permits SeparatedContainer, SequencedContainer<E>, TextDisplayContainer
-
Nested Class Summary
Nested classes/interfaces inherited from interface Component
Component.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSequencedContainer(Resolver<String> resolver, Locale locale, Container container) -
Method Summary
Modifier and TypeMethodDescriptionAppends the provided element to the end of this component.addAll(Collection<E> component, Entry... entries) Appends all the elements in the specified collection to the end of this component.Adds the provided element to this component as the first element of this component.Adds the provided element to this component as the last element of this component.This method is not supported and will always throwUnsupportedOperationException.This method is not supported and will always throwUnsupportedOperationException.This method is not supported and will always throwUnsupportedOperationException.This method is not supported and will always throwUnsupportedOperationException.This method is not supported and will always throwUnsupportedOperationException.This method is not supported and will always throwUnsupportedOperationException.protected static voidAdds Entries to use for localization.entries(Collection<Entry> entries) Adds Entries to use for localization.@Nullable Integer@Unmodifiable List<ContainerChildComponentUnion> Localizes all components of this container before returning the list.
getType()intbooleanlocale()Gets theLocalethis container will be localized inSets theLocalethis component will be localized inlocale(DiscordLocale locale) Sets theLocalethis component will be localized inreplace(ComponentReplacer replacer) protected abstract Rself()toData()Localizes all components of this container before returning the
DataObject.withAccentColor(@Nullable Color accentColor) withAccentColor(@Nullable Integer accentColor) withComponents(Collection<? extends ContainerChildComponent> components) withComponents(ContainerChildComponent component, ContainerChildComponent... components) withDisabled(boolean disabled) withSpoiler(boolean spoiler) withUniqueId(int uniqueId) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Container
getAccentColor, isDisabled, isEnabled, isMessageCompatible, isModalCompatibleMethods inherited from interface IComponentUnion
isUnknownComponent
-
Field Details
-
entries
-
container
-
-
Constructor Details
-
AbstractSequencedContainer
-
-
Method Details
-
self
-
locale
Description copied from interface:LocalizedComponentGets theLocalethis container will be localized in- Specified by:
localein interfaceLocalizedComponent- Returns:
- the
Locale
-
locale
Description copied from interface:LocalizedComponentSets theLocalethis component will be localized in- Specified by:
localein interfaceLocalizedComponent- Parameters:
locale- the newDiscordLocaleto use for localization- Returns:
- this instance for fluent interface
-
locale
Description copied from interface:LocalizedComponentSets theLocalethis component will be localized in- Specified by:
localein interfaceLocalizedComponent- Parameters:
locale- the newLocaleto use for localization- Returns:
- this instance for fluent interface
-
entries
Description copied from interface:LocalizedComponentAdds Entries to use for localization.- Specified by:
entriesin interfaceLocalizedComponent- Parameters:
entries- the Entries- Returns:
- this instance for fluent interface
-
entries
Description copied from interface:LocalizedComponentAdds Entries to use for localization.- Specified by:
entriesin interfaceLocalizedComponent- Parameters:
entries- the Entries- Returns:
- this instance for fluent interface
-
add
Description copied from interface:SequencedComponentAppends the provided element to the end of this component.- Specified by:
addin interfaceSequencedComponent<E extends Component>- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addFirst
Description copied from interface:SequencedComponentAdds the provided element to this component as the first element of this component.- Specified by:
addFirstin interfaceSequencedComponent<E extends Component>- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addLast
Description copied from interface:SequencedComponentAdds the provided element to this component as the last element of this component.- Specified by:
addLastin interfaceSequencedComponent<E extends Component>- Parameters:
component- the element to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
addAll
Description copied from interface:SequencedComponentAppends all the elements in the specified collection to the end of this component.- Specified by:
addAllin interfaceSequencedComponent<E extends Component>- Parameters:
component- the elements to addentries- the Entries used for localization- Returns:
- this instance for fluent interface
-
toData
Localizes all components of this container before returning the
DataObject.- Specified by:
toDatain interfaceSerializableData- Returns:
-
getComponents
Localizes all components of this container before returning the list.
- Specified by:
getComponentsin interfaceContainer- Returns:
-
replace
- Specified by:
replacein interfaceContainer- Specified by:
replacein interfaceIReplaceable
-
withAccentColor
- Specified by:
withAccentColorin interfaceContainer
-
withAccentColor
- Specified by:
withAccentColorin interfaceContainer
-
withSpoiler
- Specified by:
withSpoilerin interfaceContainer
-
withComponents
- Specified by:
withComponentsin interfaceContainer
-
withComponents
- Specified by:
withComponentsin interfaceContainer
-
withDisabled
- Specified by:
withDisabledin interfaceContainer- Specified by:
withDisabledin interfaceIDisableable
-
asDisabled
- Specified by:
asDisabledin interfaceContainer- Specified by:
asDisabledin interfaceIDisableable
-
asEnabled
- Specified by:
asEnabledin interfaceContainer- Specified by:
asEnabledin interfaceIDisableable
-
withUniqueId
- Specified by:
withUniqueIdin interfaceComponent- Specified by:
withUniqueIdin interfaceContainer- Specified by:
withUniqueIdin interfaceIComponentUnion- Specified by:
withUniqueIdin interfaceIDisableable- Specified by:
withUniqueIdin interfaceMessageTopLevelComponent- Specified by:
withUniqueIdin interfaceMessageTopLevelComponentUnion
-
getType
-
getUniqueId
public int getUniqueId()- Specified by:
getUniqueIdin interfaceComponent
-
getAccentColorRaw
- Specified by:
getAccentColorRawin interfaceContainer
-
isSpoiler
-
asContainer
- Specified by:
asContainerin interfaceMessageTopLevelComponentUnion
-
asActionRow
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asActionRowin interfaceMessageTopLevelComponentUnion
-
asSection
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asSectionin interfaceMessageTopLevelComponentUnion
-
asTextDisplay
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asTextDisplayin interfaceMessageTopLevelComponentUnion
-
asMediaGallery
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asMediaGalleryin interfaceMessageTopLevelComponentUnion
-
asSeparator
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asSeparatorin interfaceMessageTopLevelComponentUnion
-
asFileDisplay
This method is not supported and will always throwUnsupportedOperationException.- Specified by:
asFileDisplayin interfaceMessageTopLevelComponentUnion
-
checkAccess
protected static void checkAccess()
-