Class ModalMapping
java.lang.Object
net.dv8tion.jda.api.interactions.modals.ModalMapping
ID/Value pair for a
ModalInteractionEvent
.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionModalMapping
(net.dv8tion.jda.internal.interactions.InteractionImpl interaction, DataObject resolved, DataObject object) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns this component's value as a list of Longs.Returns this component's value as aMentions
object.The String representation of this component.The String list representation of this component.The custom id of the component owning this datagetType()
TheType
of this componentint
The unique, numeric id of the component owning this dataint
hashCode()
toString()
-
Constructor Details
-
ModalMapping
public ModalMapping(net.dv8tion.jda.internal.interactions.InteractionImpl interaction, DataObject resolved, DataObject object)
-
-
Method Details
-
getCustomId
The custom id of the component owning this data- Returns:
- The custom id of the component
-
getUniqueId
public int getUniqueId()The unique, numeric id of the component owning this data- Returns:
- The numeric id of the component
-
getType
TheType
of this component- Returns:
- Type of this component
-
getAsString
The String representation of this component.For
TextInputs
, this returns what the User typed in it.Use
getType()
to check if this method can be used safely!- Returns:
- The String representation of this component.
- Throws:
IllegalStateException
- If this ModalMapping cannot be represented as a String.
-
getAsStringList
The String list representation of this component.Return values include:
-
For
StringSelectMenus
, this returns the values chosen by the User. -
For
EntitySelectMenus
, this returns the entity IDs chosen by the User.
Use
getType()
to check if this method can be used safely!- Returns:
- The string list representation of this component.
- Throws:
IllegalStateException
- If this ModalMapping cannot be represented as a List of Strings.
-
For
-
getAsLongList
Returns this component's value as a list of Longs.This is available if the component was an
EntitySelectMenu
.You can use
getType()
andComponent.Type.isEntitySelectMenu()
to check if this method can be used safely.- Returns:
- This component's value as a list of Longs.
- Throws:
IllegalStateException
- If this ModalMapping cannot be represented as such
-
getAsMentions
Returns this component's value as aMentions
object.This is available if the component was an
EntitySelectMenu
.You can use
getType()
andComponent.Type.isEntitySelectMenu()
to check if this method can be used safely.- Returns:
- This component's value as a
Mentions
object. - Throws:
IllegalStateException
- If this ModalMapping cannot be represented as such
-
toString
-
equals
-
hashCode
public int hashCode()
-