Class EntitySelectMenu.DefaultValue
java.lang.Object
net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu.DefaultValue
- All Implemented Interfaces:
ISnowflake
,SerializableData
- Enclosing interface:
- EntitySelectMenu
public static class EntitySelectMenu.DefaultValue
extends Object
implements ISnowflake, SerializableData
Represents the default values used in
The value is
EntitySelectMenu.getDefaultValues()
.
The value is
typed
correspondingly to the menu entity types
.
The value is represented by the ID
, corresponding to the entity of that ID.
-
Method Summary
Modifier and TypeMethodDescriptionchannel
(long id) Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
with the provided id.Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
with the provided id.boolean
from
(GuildChannel channel) Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
for the provided channel.Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
for the provided role.from
(UserSnowflake user) Creates a default value of typeEntitySelectMenu.SelectTarget.USER
for the provided user.fromData
(DataObject object) Parses the providedDataObject
into the default value.long
The Snowflake id of this entity.getType()
int
hashCode()
role
(long id) Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
with the provided id.Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
with the provided id.toData()
SerializedDataObject
for this object.toString()
user
(long id) Creates a default value of typeEntitySelectMenu.SelectTarget.USER
with the provided id.Creates a default value of typeEntitySelectMenu.SelectTarget.USER
with the provided id.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Method Details
-
fromData
Parses the providedDataObject
into the default value.- Parameters:
object
- The serialized default value, with a valid type and id- Returns:
- Parsed default value
- Throws:
IllegalArgumentException
- If the provided object is invalid or missing required keys
-
from
Creates a default value of typeEntitySelectMenu.SelectTarget.USER
for the provided user.- Parameters:
user
- The corresponding user- Returns:
- The default value
- Throws:
IllegalArgumentException
- If null is provided
-
from
Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
for the provided role.- Parameters:
role
- The corresponding role- Returns:
- The default value
- Throws:
IllegalArgumentException
- If null is provided
-
from
Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
for the provided channel.- Parameters:
channel
- The corresponding channel- Returns:
- The default value
- Throws:
IllegalArgumentException
- If null is provided
-
role
Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
with the provided id.- Parameters:
id
- The role id- Returns:
- The default value
-
role
Creates a default value of typeEntitySelectMenu.SelectTarget.ROLE
with the provided id.- Parameters:
id
- The role id- Returns:
- The default value
- Throws:
IllegalArgumentException
- If the provided id is not a valid snowflake
-
user
Creates a default value of typeEntitySelectMenu.SelectTarget.USER
with the provided id.- Parameters:
id
- The user id- Returns:
- The default value
-
user
Creates a default value of typeEntitySelectMenu.SelectTarget.USER
with the provided id.- Parameters:
id
- The user id- Returns:
- The default value
- Throws:
IllegalArgumentException
- If the provided id is not a valid snowflake
-
channel
Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
with the provided id.- Parameters:
id
- The channel id- Returns:
- The default value
-
channel
Creates a default value of typeEntitySelectMenu.SelectTarget.CHANNEL
with the provided id.- Parameters:
id
- The channel id- Returns:
- The default value
- Throws:
IllegalArgumentException
- If the provided id is not a valid snowflake
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getType
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-
hashCode
public int hashCode() -
equals
-
toString
-