Class ChannelOrderAction<T extends Channel>
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<java.lang.Void>
-
- net.dv8tion.jda.core.requests.restaction.order.OrderAction<T,ChannelOrderAction<T>>
-
- net.dv8tion.jda.core.requests.restaction.order.ChannelOrderAction<T>
-
- Type Parameters:
T
- The type ofChannel
defining which channels to order
- Direct Known Subclasses:
CategoryOrderAction
public class ChannelOrderAction<T extends Channel> extends OrderAction<T,ChannelOrderAction<T>>
Implementation ofOrderAction
to modify the order ofChannels
for aGuild
.
To apply the changes you must finish theRestAction
.Before you can use any of the
move
methods you must use eitherselectPosition(Channel)
orOrderAction.selectPosition(int)
!- Since:
- 3.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.RestAction
RestAction.EmptyRestAction<T>
-
-
Field Summary
-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description ChannelOrderAction(Guild guild, ChannelType type)
Creates a new ChannelOrderAction instanceChannelOrderAction(Guild guild, ChannelType type, java.util.Collection<T> channels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelType
getChannelType()
TheChannelType
of all channels that are ordered by this ChannelOrderActionGuild
getGuild()
TheGuild
which holds the channels fromOrderAction.getCurrentOrder()
-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.order.OrderAction
getCurrentOrder, getSelectedEntity, getSelectedPosition, moveDown, moveTo, moveUp, reverseOrder, selectPosition, selectPosition, setCheck, shuffleOrder, sortOrder, swapPosition, swapPosition
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Constructor Detail
-
ChannelOrderAction
public ChannelOrderAction(Guild guild, ChannelType type)
Creates a new ChannelOrderAction instance- Parameters:
guild
- The targetGuild
of which to order the channels defined by the specified typetype
- TheChannelType
corresponding to the generic type ofChannel
which defines the type of channel that will be ordered.- Throws:
java.lang.IllegalArgumentException
- If one of the specified Guild has no channels of the ChannelType.
-
ChannelOrderAction
public ChannelOrderAction(Guild guild, ChannelType type, java.util.Collection<T> channels)
Creates a new ChannelOrderAction instance using the providedGuild
, as well as the provided list ofChannels
.- Parameters:
guild
- The targetGuild
of which to order the channels defined by the specified typetype
- TheChannelType
corresponding to the generic type ofChannel
which defines the type of channel that will be ordered.channels
- TheChannels
to order, all of which are on the same Guild specified, and all of which are of the same generic type of Channel corresponding to the the ChannelType specified.- Throws:
java.lang.IllegalArgumentException
- If the channels arenull
, an empty collection, or any of them do not have the same ChannelType as the one provided.
-
-
Method Detail
-
getGuild
public Guild getGuild()
TheGuild
which holds the channels fromOrderAction.getCurrentOrder()
- Returns:
- The corresponding
Guild
-
getChannelType
public ChannelType getChannelType()
TheChannelType
of all channels that are ordered by this ChannelOrderAction- Returns:
- The corresponding
ChannelType
-
-