Interface IPermissionContainerUnion
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,IDetachableEntity,IMentionable,IPermissionContainer,ISnowflake
A union representing all channel types that implement
This class extends
This interface represents the follow concrete channel types:
IPermissionContainer.
This class extends
IPermissionContainer and primarily acts as a discovery tool for
developers to discover some common interfaces that a IPermissionContainer 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 aAudioChannel.Casts this union to aCategory.Casts this union to aForumChannel.Casts this union to aGuildMessageChannel.Casts this union to aNewsChannel.Casts this union to aStageChannel.Casts this union to aStandardGuildChannel.Casts this union to aStandardGuildMessageChannel.Casts this union to aTextChannel.Casts this union to aIThreadContainer.Casts this union to aVoiceChannel.Methods 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.detached.IDetachableEntity
isDetachedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainer
getManager, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
asTextChannel
Casts this union to aTextChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! TextChannel channel = union.asTextChannel(); TextChannel channel2 = (TextChannel) union;Channel.getType()to see if the channel is of typeChannelType.TEXTto validate whether you can call this method in addition to normal instanceof checks:channel instanceof TextChannel- Returns:
- The channel as a
TextChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aTextChannel.
-
asNewsChannel
Casts this union to aNewsChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! NewsChannel channel = union.asNewsChannel(); NewsChannel channel2 = (NewsChannel) union;Channel.getType()to see if the channel is of typeChannelType.NEWSto validate whether you can call this method in addition to normal instanceof checks:channel instanceof NewsChannel- Returns:
- The channel as a
NewsChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aNewsChannel.
-
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.
-
asCategory
Casts this union to aCategory. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! Category channel = union.asCategory(); Category channel2 = (Category) union;Channel.getType()to see if the channel is of typeChannelType.CATEGORYto validate whether you can call this method in addition to normal instanceof checks:channel instanceof Category- Returns:
- The channel as a
Category - Throws:
IllegalStateException- If the channel represented by this union is not actually aCategory.
-
asForumChannel
Casts this union to aForumChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! ForumChannel channel = union.asForumChannel(); ForumChannel channel2 = (ForumChannel) union;Channel.getType()to see if the channel is of typeChannelType.FORUMto validate whether you can call this method in addition to normal instanceof checks:channel instanceof ForumChannel- Returns:
- The channel as a
ForumChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aForumChannel.
-
asGuildMessageChannel
Casts this union to aGuildMessageChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! GuildMessageChannel channel = union.asGuildMessageChannel(); GuildMessageChannel channel2 = (GuildMessageChannel) union;Channel.getType().isGuild()andChannel.getType().isMessage()to validate whether you can call this method in addition to normal instanceof checks:channel instanceof GuildMessageChannel- Returns:
- The channel as a
GuildMessageChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aGuildMessageChannel.
-
asAudioChannel
Casts this union to aAudioChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! AudioChannel channel = union.asAudioChannel(); AudioChannel channel2 = (AudioChannel) union;Channel.getType().isAudio()to validate whether you can call this method in addition to normal instanceof checks:channel instanceof AudioChannel- Returns:
- The channel as a
AudioChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aAudioChannel.
-
asThreadContainer
IThreadContainer asThreadContainer()Casts this union to aIThreadContainer. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
You can use//These are the same! IThreadContainer channel = union.asThreadContainer(); IThreadContainer channel2 = (IThreadContainer) union;channel instanceof IThreadContainerto validate whether you can call this method.- Returns:
- The channel as a
IThreadContainer - Throws:
IllegalStateException- If the channel represented by this union is not actually aIThreadContainer.
-
asStandardGuildChannel
Casts this union to aStandardGuildChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! StandardGuildChannel channel = union.asStandardGuildChannel(); StandardGuildChannel channel2 = (StandardGuildChannel) union;- Returns:
- The channel as a
StandardGuildChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aStandardGuildChannel.
-
asStandardGuildMessageChannel
Casts this union to aStandardGuildMessageChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator:
//These are the same! StandardGuildMessageChannel channel = union.asStandardGuildMessageChannel(); StandardGuildMessageChannel channel2 = (StandardGuildMessageChannel) union;- Returns:
- The channel as a
StandardGuildMessageChannel - Throws:
IllegalStateException- If the channel represented by this union is not actually aStandardGuildMessageChannel.
-