Enum Component.Type
- All Implemented Interfaces:
Serializable
,Comparable<Component.Type>
- Enclosing interface:
- Component
The component types
-
Enum Constant Summary
Enum ConstantDescriptionA row of componentsA buttonA select menu of channelsA select menu of users and rolesA select menu of rolesA select menu of stringsA text input fieldA select menu of users -
Method Summary
Modifier and TypeMethodDescriptionstatic Component.Type
fromKey
(int type) Maps the provided type id to the respective enum instance.int
getKey()
Raw int representing this ComponentTypeint
How many of these components can be added to oneActionRow
.boolean
Whether this component can be used inMessages
.boolean
Whether this component can be used inModals
.static Component.Type
Returns the enum constant of this type with the specified name.static Component.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
-
ACTION_ROW
A row of components -
BUTTON
A button -
STRING_SELECT
A select menu of strings -
TEXT_INPUT
A text input field -
USER_SELECT
A select menu of users -
ROLE_SELECT
A select menu of roles -
MENTIONABLE_SELECT
A select menu of users and roles -
CHANNEL_SELECT
A select menu of channels
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getMaxPerRow
public int getMaxPerRow()How many of these components can be added to oneActionRow
.- Returns:
- The maximum amount an action row can contain
-
getKey
public int getKey()Raw int representing this ComponentTypeThis returns -1 if it's of type
UNKNOWN
.- Returns:
- Raw int representing this ComponentType
-
isMessageCompatible
public boolean isMessageCompatible()Whether this component can be used inMessages
.- Returns:
- Whether this component can be used in Messages.
-
isModalCompatible
public boolean isModalCompatible()Whether this component can be used inModals
.- Returns:
- Whether this component can be used in Modals.
-
fromKey
Maps the provided type id to the respective enum instance.- Parameters:
type
- The raw type id- Returns:
- The Type or
UNKNOWN
-