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 Channel
MAX_NAME_LENGTHFields inherited from interface 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 AudioChannel
getBitrate, getManager, getRegion, getRegionRaw, getUserLimitMethods inherited from interface Comparable
compareToMethods inherited from interface GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainerMethods inherited from interface ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, getPositionInCategory, isSyncedMethods inherited from interface IDetachableEntity
isDetachedMethods inherited from interface IInviteContainer
createInvite, retrieveInvitesMethods inherited from interface IMemberContainer
getMembersMethods inherited from interface IPermissionContainer
getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverrideMethods inherited from interface IPositionableChannel
getPosition, getPositionRawMethods inherited from interface ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface 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.
-