Class ChannelOrderActionImpl
java.lang.Object
net.dv8tion.jda.internal.requests.RestActionImpl<Void>
net.dv8tion.jda.internal.requests.restaction.order.OrderActionImpl<GuildChannel,ChannelOrderAction>
net.dv8tion.jda.internal.requests.restaction.order.ChannelOrderActionImpl
- All Implemented Interfaces:
RestAction<Void>
,ChannelOrderAction
,OrderAction<GuildChannel,
ChannelOrderAction>
- Direct Known Subclasses:
CategoryOrderActionImpl
public class ChannelOrderActionImpl
extends OrderActionImpl<GuildChannel,ChannelOrderAction>
implements ChannelOrderAction
-
Field Summary
Fields inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
LOG
-
Constructor Summary
ConstructorsConstructorDescriptionChannelOrderActionImpl
(Guild guild, int bucket) Creates a new ChannelOrderAction instanceChannelOrderActionImpl
(Guild guild, int bucket, Collection<? extends GuildChannel> channels) -
Method Summary
Modifier and TypeMethodDescriptiongetGuild()
TheGuild
which holds the channels fromOrderAction.getCurrentOrder()
int
The sorting bucket for this order action.setCategory
(Category category, boolean syncPermissions) Set the parent category for the currently selected channel.Methods inherited from class net.dv8tion.jda.internal.requests.restaction.order.OrderActionImpl
deadline, getCurrentOrder, getSelectedEntity, getSelectedPosition, isAscendingOrder, moveAbove, moveBelow, moveDown, moveTo, moveUp, reverseOrder, selectPosition, selectPosition, setCheck, shuffleOrder, sortOrder, swapPosition, swapPosition, timeout
Methods inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
complete, getCheck, getDefaultFailure, getDefaultSuccess, getDefaultTimeout, getJDA, handleResponse, isPassContext, priority, queue, setDefaultFailure, setDefaultSuccess, setDefaultTimeout, setErrorMapper, setPassContext, submit
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.order.ChannelOrderAction
getChannelTypes, setCategory
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.order.OrderAction
deadline, getCurrentOrder, getSelectedEntity, getSelectedPosition, isAscendingOrder, moveAbove, moveBelow, moveDown, moveTo, moveUp, reverseOrder, selectPosition, selectPosition, setCheck, shuffleOrder, sortOrder, swapPosition, swapPosition, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Constructor Details
-
ChannelOrderActionImpl
Creates a new ChannelOrderAction instance- Parameters:
guild
- The targetGuild
of which to order the channels defined by the specified typebucket
- The sorting bucket
-
ChannelOrderActionImpl
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 typebucket
- The sorting bucketchannels
- TheChannels
to order, all of which are on the same Guild specified, and all of which are of the same generic type of GuildChannel corresponding to the the ChannelType specified.- Throws:
IllegalArgumentException
- If the channels arenull
, an empty collection, or any of them do not have the same ChannelType as the one provided.
-
-
Method Details
-
getGuild
Description copied from interface:ChannelOrderAction
TheGuild
which holds the channels fromOrderAction.getCurrentOrder()
- Specified by:
getGuild
in interfaceChannelOrderAction
- Returns:
- The corresponding
Guild
-
getSortBucket
public int getSortBucket()Description copied from interface:ChannelOrderAction
The sorting bucket for this order action.
Multiple differentChannelTypes
can share a common sorting bucket.- Specified by:
getSortBucket
in interfaceChannelOrderAction
- Returns:
- The sorting bucket
-
setCategory
@Nonnull public ChannelOrderAction setCategory(@Nullable Category category, boolean syncPermissions) Description copied from interface:ChannelOrderAction
Set the parent category for the currently selected channel.- Specified by:
setCategory
in interfaceChannelOrderAction
- Parameters:
category
- The new parent category, or null to not have any categorysyncPermissions
- Whether to sync the permissions of the channel to the new category- Returns:
- The current ChannelOrderAction
-