Enum Component.Type

java.lang.Object
java.lang.Enum<Component.Type>
net.dv8tion.jda.api.interactions.components.Component.Type
All Implemented Interfaces:
Serializable, Comparable<Component.Type>
Enclosing interface:
Component

public static enum Component.Type extends Enum<Component.Type>
The component types
  • Enum Constant Details

    • UNKNOWN

      public static final Component.Type UNKNOWN
    • ACTION_ROW

      public static final Component.Type ACTION_ROW
      A row of components
    • BUTTON

      public static final Component.Type BUTTON
      A button
    • STRING_SELECT

      public static final Component.Type STRING_SELECT
      A select menu of strings
    • TEXT_INPUT

      public static final Component.Type TEXT_INPUT
      A text input field
    • USER_SELECT

      public static final Component.Type USER_SELECT
      A select menu of users
    • ROLE_SELECT

      public static final Component.Type ROLE_SELECT
      A select menu of roles
    • MENTIONABLE_SELECT

      public static final Component.Type MENTIONABLE_SELECT
      A select menu of users and roles
    • CHANNEL_SELECT

      public static final Component.Type CHANNEL_SELECT
      A select menu of channels
  • Method Details

    • values

      public static Component.Type[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Component.Type valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getMaxPerRow

      public int getMaxPerRow()
      How many of these components can be added to one ActionRow.
      Returns:
      The maximum amount an action row can contain
    • getKey

      public int getKey()
      Raw int representing this ComponentType

      This returns -1 if it's of type UNKNOWN.

      Returns:
      Raw int representing this ComponentType
    • isMessageCompatible

      public boolean isMessageCompatible()
      Whether this component can be used in Messages.
      Returns:
      Whether this component can be used in Messages.
    • isModalCompatible

      public boolean isModalCompatible()
      Whether this component can be used in Modals.
      Returns:
      Whether this component can be used in Modals.
    • fromKey

      @Nonnull public static Component.Type fromKey(int type)
      Maps the provided type id to the respective enum instance.
      Parameters:
      type - The raw type id
      Returns:
      The Type or UNKNOWN