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 TypeMethodDescriptionbooleanReturns this component's value as a list ofAttachmentobjects.Returns this component's value as a list of Longs.Returns this component's value as aMentionsobject.The String representation of this component.The String list representation of this component.The custom id of the component owning this datagetType()TheTypeof this componentintThe unique, numeric id of the component owning this datainthashCode()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
TheTypeof 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 aMentionsobject.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
Mentionsobject. - Throws:
IllegalStateException- If this ModalMapping cannot be represented as such
-
getAsAttachmentList
Returns this component's value as a list ofAttachmentobjects.You can check if
getType()is equal toFILE_UPLOADto see if this method can be used safely!- Returns:
- This component's value as a list of
Attachmentobjects - Throws:
IllegalStateException- If this ModalMapping cannot be represented as such.
-
toString
-
equals
-
hashCode
public int hashCode()
-