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

  • 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