Create constructor that allows to input any String Collection.

This commit is contained in:
BONNe1704 2019-01-18 17:22:44 +02:00
parent fb06dae7ab
commit 97174930d5

View File

@ -3,6 +3,8 @@ package world.bentobox.challenges.panel.util;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
@ -19,6 +21,12 @@ import world.bentobox.bentobox.api.user.User;
*/ */
public class StringListGUI public class StringListGUI
{ {
public StringListGUI(User user, Collection<String> value, BiConsumer<Boolean, List<String>> consumer)
{
this(user, new ArrayList<>(value), consumer);
}
public StringListGUI(User user, List<String> value, BiConsumer<Boolean, List<String>> consumer) public StringListGUI(User user, List<String> value, BiConsumer<Boolean, List<String>> consumer)
{ {
this.consumer = consumer; this.consumer = consumer;