Interface AudioChannelUnion
- All Superinterfaces:
AudioChannel,Channel,Comparable<GuildChannel>,Formattable,GuildChannel,ICategorizableChannel,ICopyableChannel,IDetachableEntity,IInviteContainer,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISnowflake,StandardGuildChannel
A union representing all channel types that implement
This class extends
This interface represents the follow concrete channel types:
AudioChannel.
This class extends
AudioChannel and primarily acts as a discovery tool for
developers to discover some common interfaces that a AudioChannel could be cast to.
This interface represents the follow concrete channel types:
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTHFields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL -
Method Summary
Modifier and TypeMethodDescriptionCasts this union to aGuildMessageChannel.Casts this union to aStageChannel.Casts this union to aVoiceChannel.Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.AudioChannel
getBitrate, getManager, getRegion, getRegionRaw, getUserLimitMethods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getTypeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainerMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, getPositionInCategory, isSyncedMethods inherited from interface net.dv8tion.jda.api.entities.detached.IDetachableEntity
isDetachedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IInviteContainer
createInvite, retrieveInvitesMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IMemberContainer
getMembersMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainer
getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPositionableChannel
getPosition, getPositionRawMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.StandardGuildChannel
createCopy, createCopy
-
Method Details
-
asVoiceChannel
Casts this union to aVoiceChannel.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! VoiceChannel channel = union.asVoiceChannel(); VoiceChannel channel2 = (VoiceChannel) union;Channel.getType()to see if the channel is of typeChannelType.VOICEto validate whether you can call this method in addition to normal instanceof checks:channel instanceof VoiceChannel- Returns:
- The channel as a
VoiceChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aVoiceChannel.
-
asStageChannel
Casts this union to aStageChannel.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! StageChannel channel = union.asStageChannel(); StageChannel channel2 = (StageChannel) union;Channel.getType()to see if the channel is of typeChannelType.STAGEto validate whether you can call this method in addition to normal instanceof checks:channel instanceof StageChannel- Returns:
- The channel as a
StageChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aStageChannel.
-
asGuildMessageChannel
Casts this union to aGuildMessageChannel.
This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! GuildMessageChannel channel = union.asGuildMessageChannel(); GuildMessageChannel channel2 = (GuildMessageChannel) union;- Returns:
- The channel as a
GuildMessageChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aGuildMessageChannel.
-