Skip to content

Commit

Permalink
Fix wrong javadoc naming for LayoutComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Jan 15, 2022
1 parent e38137e commit a035088
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions src/main/java/net/dv8tion/jda/api/entities/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,11 @@ default MessageAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
}

/**
* Edits this Message's content to the provided {@link LayoutComponent ComponentLayouts}.
* Edits this Message's content to the provided {@link LayoutComponent LayoutComponents}.
* <br><b>Messages can only be edited by the account that sent them!</b>.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>This message instance will not be updated by this operation, please use the response message instead.
*
Expand Down Expand Up @@ -1145,7 +1145,7 @@ default MessageAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
* }</pre>
*
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
Expand All @@ -1163,11 +1163,11 @@ default MessageAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
MessageAction editMessageComponents(@Nonnull Collection<? extends LayoutComponent> components);

/**
* Edits this Message's content to the provided {@link LayoutComponent ComponentLayouts}.
* Edits this Message's content to the provided {@link LayoutComponent LayoutComponents}.
* <br><b>Messages can only be edited by the account that sent them!</b>.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>This message instance will not be updated by this operation, please use the response message instead.
*
Expand Down Expand Up @@ -1198,7 +1198,7 @@ default MessageAction editMessageEmbeds(@Nonnull MessageEmbed... embeds)
* }</pre>
*
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws java.lang.UnsupportedOperationException
* If this is not a Received Message from {@link net.dv8tion.jda.api.entities.MessageType#DEFAULT MessageType.DEFAULT}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/net/dv8tion/jda/api/entities/MessageChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ default MessageAction editMessageEmbedsById(long messageId, @Nonnull Collection<
* Attempts to edit a message by its id in this MessageChannel.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
Expand Down Expand Up @@ -3200,14 +3200,14 @@ default MessageAction editMessageEmbedsById(long messageId, @Nonnull Collection<
* @param messageId
* The id referencing the Message that should be edited
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws UnsupportedOperationException
* If the component layout is a custom implementation that is not supported by this interface
* @throws IllegalArgumentException
* <ul>
* <li>If provided {@code messageId} is {@code null} or empty.</li>
* <li>If any of the provided {@link LayoutComponent ComponentLayouts} is null</li>
* <li>If any of the provided {@link LayoutComponent LayoutComponents} is null</li>
* </ul>
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If this is a TextChannel and this account does not have
Expand All @@ -3233,7 +3233,7 @@ default MessageAction editMessageComponentsById(@Nonnull String messageId, @Nonn
* Attempts to edit a message by its id in this MessageChannel.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
Expand Down Expand Up @@ -3266,12 +3266,12 @@ default MessageAction editMessageComponentsById(@Nonnull String messageId, @Nonn
* @param messageId
* The id referencing the Message that should be edited
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws UnsupportedOperationException
* If the component layout is a custom implementation that is not supported by this interface
* @throws IllegalArgumentException
* If any of the provided {@link LayoutComponent ComponentLayouts} is null
* If any of the provided {@link LayoutComponent LayoutComponents} is null
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If this is a TextChannel and this account does not have
* {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL Permission.VIEW_CHANNEL}
Expand All @@ -3291,7 +3291,7 @@ default MessageAction editMessageComponentsById(long messageId, @Nonnull Collect
* Attempts to edit a message by its id in this MessageChannel.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
Expand Down Expand Up @@ -3323,14 +3323,14 @@ default MessageAction editMessageComponentsById(long messageId, @Nonnull Collect
* @param messageId
* The id referencing the Message that should be edited
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws UnsupportedOperationException
* If the component layout is a custom implementation that is not supported by this interface
* @throws IllegalArgumentException
* <ul>
* <li>If provided {@code messageId} is {@code null} or empty.</li>
* <li>If any of the provided {@link LayoutComponent ComponentLayouts} is null</li>
* <li>If any of the provided {@link LayoutComponent LayoutComponents} is null</li>
* </ul>
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If this is a TextChannel and this account does not have
Expand All @@ -3352,7 +3352,7 @@ default MessageAction editMessageComponentsById(@Nonnull String messageId, @Nonn
* Attempts to edit a message by its id in this MessageChannel.
* <br>This will replace all the current {@link net.dv8tion.jda.api.interactions.components.Component Components},
* such as {@link Button Buttons} or {@link SelectMenu SelectMenus} on this message.
* The provided parameters are {@link LayoutComponent ComponentLayout} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
* The provided parameters are {@link LayoutComponent LayoutComponent} such as {@link ActionRow} which contain a list of components to arrange in the respective layout.
*
* <p>The following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} are possible:
* <ul>
Expand Down Expand Up @@ -3384,12 +3384,12 @@ default MessageAction editMessageComponentsById(@Nonnull String messageId, @Nonn
* @param messageId
* The id referencing the Message that should be edited
* @param components
* Up to 5 new {@link LayoutComponent ComponentLayouts} for the edited message, such as {@link ActionRow}
* Up to 5 new {@link LayoutComponent LayoutComponents} for the edited message, such as {@link ActionRow}
*
* @throws UnsupportedOperationException
* If the component layout is a custom implementation that is not supported by this interface
* @throws IllegalArgumentException
* If any of the provided {@link LayoutComponent ComponentLayouts} is null
* If any of the provided {@link LayoutComponent LayoutComponents} is null
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
* If this is a TextChannel and this account does not have
* {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL Permission.VIEW_CHANNEL}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/dv8tion/jda/api/entities/WebhookClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ default WebhookMessageUpdateAction<T> editMessageEmbedsById(long messageId, @Non
*/
@Nonnull
@CheckReturnValue
WebhookMessageUpdateAction<T> editMessageComponentsById(@Nonnull String messageId, @Nonnull Collection<? extends LayoutComponent> components); // We use ComponentLayout for forward compatibility here
WebhookMessageUpdateAction<T> editMessageComponentsById(@Nonnull String messageId, @Nonnull Collection<? extends LayoutComponent> components); // We use LayoutComponent for forward compatibility here

/**
* Edit an existing message sent by this webhook.
Expand Down Expand Up @@ -758,7 +758,7 @@ default WebhookMessageUpdateAction<T> editMessageComponentsById(long messageId,
@CheckReturnValue
default WebhookMessageUpdateAction<T> editMessageComponentsById(@Nonnull String messageId, @Nonnull LayoutComponent... components)
{
Checks.noneNull(components, "ComponentLayouts");
Checks.noneNull(components, "LayoutComponents");
return editMessageComponentsById(messageId, Arrays.asList(components));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ default MessageEditCallbackAction editComponents(@Nonnull Collection<? extends L
@CheckReturnValue
default MessageEditCallbackAction editComponents(@Nonnull LayoutComponent... components)
{
Checks.noneNull(components, "ComponentLayouts");
Checks.noneNull(components, "LayoutComponents");
return editComponents(Arrays.asList(components));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ default ReplyCallbackAction replyEmbeds(@Nonnull MessageEmbed embed, @Nonnull Me
// * <p>If your handling can take longer than 3 seconds, due to various rate limits or other conditions, you should use {@link #deferReply()} instead.
// *
// * @param components
// * The {@link ComponentLayout ComponentLayouts} to send, such as {@link ActionRow}
// * The {@link LayoutComponent LayoutComponents} to send, such as {@link ActionRow}
// *
// * @throws IllegalArgumentException
// * If null is provided
Expand All @@ -225,7 +225,7 @@ default ReplyCallbackAction replyEmbeds(@Nonnull MessageEmbed embed, @Nonnull Me
// */
// @Nonnull
// @CheckReturnValue
// default ReplyAction replyComponents(@Nonnull Collection<? extends ComponentLayout> components)
// default ReplyAction replyComponents(@Nonnull Collection<? extends LayoutComponent> components)
// {
// if (components.stream().anyMatch(it -> !(it instanceof ActionRow)))
// throw new UnsupportedOperationException("Only ActionRow layouts are currently supported.");
Expand All @@ -246,7 +246,7 @@ default ReplyCallbackAction replyEmbeds(@Nonnull MessageEmbed embed, @Nonnull Me
// * <p>If your handling can take longer than 3 seconds, due to various rate limits or other conditions, you should use {@link #deferReply()} instead.
// *
// * @param components
// * The {@link ComponentLayout ComponentLayouts} to send, such as {@link ActionRow}
// * The {@link LayoutComponent LayoutComponents} to send, such as {@link ActionRow}
// *
// * @throws IllegalArgumentException
// * If null is provided
Expand All @@ -255,11 +255,11 @@ default ReplyCallbackAction replyEmbeds(@Nonnull MessageEmbed embed, @Nonnull Me
// */
// @Nonnull
// @CheckReturnValue
// default ReplyAction replyComponents(@Nonnull ComponentLayout component, @Nonnull ComponentLayout... components)
// default ReplyAction replyComponents(@Nonnull LayoutComponent component, @Nonnull LayoutComponent... components)
// {
// Checks.notNull(component, "ComponentLayouts");
// Checks.noneNull(components, "ComponentLayouts");
// List<ComponentLayout> layouts = new ArrayList<>();
// Checks.notNull(component, "LayoutComponents");
// Checks.noneNull(components, "LayoutComponents");
// List<LayoutComponent> layouts = new ArrayList<>();
// layouts.add(component);
// Collections.addAll(layouts, components);
// return replyComponents(layouts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ default ActionComponent updateComponent(@Nonnull String id, @Nullable ActionComp
*/
static boolean updateComponent(@Nonnull List<? extends LayoutComponent> layouts, @Nonnull String id, @Nullable ActionComponent newComponent)
{
Checks.notNull(layouts, "ComponentLayout");
Checks.notNull(layouts, "LayoutComponent");
Checks.notEmpty(id, "ID or URL");
for (Iterator<? extends LayoutComponent> it = layouts.iterator(); it.hasNext();)
{
Expand All @@ -219,7 +219,7 @@ static boolean updateComponent(@Nonnull List<? extends LayoutComponent> layouts,
if (components.getComponents().isEmpty())
it.remove();
else if (!components.isValid() && newComponent != null)
throw new IllegalArgumentException("Cannot replace " + oldComponent.getType() + " with " + newComponent.getType() + " due to a violation of the layout maximum. The resulting ComponentLayout is invalid!");
throw new IllegalArgumentException("Cannot replace " + oldComponent.getType() + " with " + newComponent.getType() + " due to a violation of the layout maximum. The resulting LayoutComponent is invalid!");
return !Objects.equals(oldComponent, newComponent);
}
}
Expand Down

0 comments on commit a035088

Please sign in to comment.