Class ModalMapping
-
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.booleanThe boolean representation of this component.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 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
-
getAsString
The String representation of this component.Return values include:
-
For
TextInputs, this returns what the User typed in it -
For required
RadioGroups, this returns the value of the option chosen by the User
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
-
If this ModalMapping is for a
RadioGroupand it contains no value, usegetAsOptionalString()instead
-
For
-
getAsOptionalString
The String representation of this component.Return values include:
-
For
TextInputs, this returns what the User typed in it, ornullif left empty -
For
RadioGroups, this returns the value of the option chosen by the User, ornullif no option was chosen
Use
getType()to check if this method can be used safely!- Returns:
- The String representation of this component, or
nullif absent. - Throws:
IllegalStateException- If this ModalMapping cannot be represented as a String.
-
For
-
getAsBoolean
public boolean getAsBoolean()The boolean representation of this component.For
Checkboxes, this returnstrueif it was checked.Use
getType()to check if this method can be used safely!- Returns:
- The boolean representation of this component.
- Throws:
IllegalStateException- If this ModalMapping cannot be represented as a boolean.
-
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. -
For
CheckboxGroups, this returns the values 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
-