Skip to content

Commit

Permalink
Add missing Collection overload (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Jun 8, 2021
1 parent 3a086dc commit 68ceb6e
Showing 1 changed file with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import net.dv8tion.jda.api.requests.RestAction;
import net.dv8tion.jda.internal.utils.Checks;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.function.Consumer;
Expand Down Expand Up @@ -453,6 +450,21 @@ public Builder addItems(MessageEmbed... embeds)
this.embeds.addAll(Arrays.asList(embeds));
return this;
}

/**
* Adds the collection of provided {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to the list
* of items to paginate.
*
* @param embeds
* The collection of MessageEmbeds to add
*
* @return This builder
*/
public Builder addItems(Collection<MessageEmbed> embeds)
{
this.embeds.addAll(embeds);
return this;
}

/**
* Adds {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to the list of items to paginate.
Expand Down Expand Up @@ -494,6 +506,22 @@ public Builder setItems(MessageEmbed... embeds)
return this;
}

/**
* Sets the {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to paginate.
* <br>This method clears all previously set items before adding the provided collection of MessageEmbeds.
*
* @param embeds
* The collection of MessageEmbeds to set.
*
* @return This builder
*/
public Builder setItems(Collection<MessageEmbed> embeds)
{
this.embeds.clear();
addItems(embeds);
return this;
}

/**
* Sets the {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbeds} to paginate.
* <br>This method clears all previously set items before setting each String as a new MessageEmbed.
Expand Down

0 comments on commit 68ceb6e

Please sign in to comment.