Interface IThreadContainerUnion
- All Superinterfaces:
- Channel,- Comparable<GuildChannel>,- Formattable,- GuildChannel,- IDetachableEntity,- IMentionable,- IPermissionContainer,- ISnowflake,- IThreadContainer
A union representing all channel types that implement 
This class extends
This interface represents the follow concrete channel types:
IThreadContainer.
 This class extends
IThreadContainer and primarily acts as a discovery tool for
 developers to discover some common interfaces that a IThreadContainer could be cast to.
 This interface represents the follow concrete channel types:
- 
Field SummaryFields inherited from interface net.dv8tion.jda.api.entities.channel.ChannelMAX_NAME_LENGTHFields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannelJUMP_URL
- 
Method SummaryModifier and TypeMethodDescriptionCasts this union to aForumChannel.Casts this union to aGuildMessageChannel.Casts this union to aMediaChannel.Casts this union to aNewsChannel.Casts this union to aStandardGuildChannel.Casts this union to aStandardGuildMessageChannel.Casts this union to aTextChannel.Methods inherited from interface net.dv8tion.jda.api.entities.channel.ChannelformatTo, getAsMention, getFlags, getJDA, getName, getTypeMethods inherited from interface java.lang.ComparablecompareToMethods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChanneldelete, getGuild, getJumpUrl, getPermissionContainerMethods inherited from interface net.dv8tion.jda.api.entities.detached.IDetachableEntityisDetachedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IPermissionContainergetManager, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflakegetId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IThreadContainercreateThreadChannel, createThreadChannel, createThreadChannel, createThreadChannel, getDefaultThreadSlowmode, getThreadChannels, retrieveArchivedPrivateJoinedThreadChannels, retrieveArchivedPrivateThreadChannels, retrieveArchivedPublicThreadChannels
- 
Method Details- 
asTextChannelCasts 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 a- TextChannel.
 
- 
asNewsChannelCasts 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 a- NewsChannel.
 
- 
asForumChannelCasts 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 a- ForumChannel.
 
- 
asMediaChannelCasts this union to aMediaChannel. This method exists for developer discoverability.Note: This is effectively equivalent to using the cast operator: 
 You can use//These are the same! MediaChannel channel = union.asMediaChannel(); MediaChannel channel2 = (MediaChannel) union;Channel.getType()to see if the channel is of typeChannelType.MEDIAto validate whether you can call this method in addition to normal instanceof checks:channel instanceof MediaChannel- Returns:
- The channel as a MediaChannel
- Throws:
- IllegalStateException- If the channel represented by this union is not actually a- MediaChannel.
 
- 
asGuildMessageChannelCasts this union to aGuildMessageChannel.
 This works for the following channel types represented by this union: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().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 a- GuildMessageChannel.
 
- 
asStandardGuildChannelCasts this union to aStandardGuildChannel.
 This works for the following channel types represented by this union: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 a- StandardGuildChannel.
 
- 
asStandardGuildMessageChannelCasts this union to aStandardGuildMessageChannel.
 This works for the following channel types represented by this union: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 a- StandardGuildMessageChannel.
 
 
-