Class ActionRow

    • Method Detail

      • fromData

        @Nonnull
        public static ActionRow fromData​(@Nonnull
                                         DataObject data)
        Load ActionRow from serialized representation.
        Inverse of toData().
        Parameters:
        data - Serialized version of an action row
        Returns:
        ActionRow instance
        Throws:
        ParsingException - If the provided data is not a valid action row
        java.lang.IllegalArgumentException - If the data is null or the type is not 1
      • of

        @Nonnull
        public static ActionRow of​(@Nonnull
                                   java.util.Collection<? extends Component> components)
        Create one row of interactive message components.
        You cannot currently mix different types of components and each type has its own maximum defined by Component.Type.getMaxPerRow().
        Parameters:
        components - The components for this action row
        Returns:
        The action row
        Throws:
        java.lang.IllegalArgumentException - If anything is null, empty, or an invalid number of components are provided
      • of

        @Nonnull
        public static ActionRow of​(@Nonnull
                                   Component... components)
        Create one row of interactive message components.
        You cannot currently mix different types of components and each type has its own maximum defined by Component.Type.getMaxPerRow().
        Parameters:
        components - The components for this action row
        Returns:
        The action row
        Throws:
        java.lang.IllegalArgumentException - If anything is null, empty, or an invalid number of components are provided
      • getComponents

        @Nonnull
        public java.util.List<Component> getComponents()
        Mutable list of components in this ActionRow.
        ActionRows should not be empty and are limited to 5 buttons.
        Specified by:
        getComponents in interface ComponentLayout
        Returns:
        The list of components
      • getButtons

        @Nonnull
        public java.util.List<Button> getButtons()
        Immutable list of buttons in this ActionRow.
        Specified by:
        getButtons in interface ComponentLayout
        Returns:
        Immutable list of buttons
      • iterator

        @Nonnull
        public java.util.Iterator<Component> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Component>