package stream.flarebot.flarebot.objects;

import org.eclipse.jetty.util.ConcurrentHashSet;
import stream.flarebot.flarebot.Language;
import stream.flarebot.flarebot.mod.AutoModGuild;

import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

public class GuildWrapperBuilder {

    private String guildId;
    private AutoModGuild autoModGuild = new AutoModGuild();
    private Welcome welcome = null;
    private Set<Poll> polls = new HashSet<>();
    private Set<String> autoAssignRoles = new ConcurrentHashSet<>();
    private Set<String> selfAssignRoles = new ConcurrentHashSet<>();
    private Language.Locales locale = Language.Locales.ENGLISH_UK;

    private GuildWrapperBuilder(){}

    public GuildWrapperBuilder(String guildId){
        this.guildId = guildId;
    }

    public GuildWrapperBuilder setAutoMod(AutoModGuild autoMod){
        this.autoModGuild = autoMod;
        return this;
    }

    public GuildWrapperBuilder setWelcome(Welcome welcome){
        this.welcome = welcome;
        return this;
    }

    public GuildWrapperBuilder setPolls(Set<Poll> polls){
        this.polls = polls;
        return this;
    }

    public GuildWrapperBuilder addPoll(Poll poll){
        this.polls.add(poll);
        return this;
    }

    public GuildWrapperBuilder setSelfAssignRoles(Set<String> roles){
        this.selfAssignRoles = roles;
        return this;
    }

    public GuildWrapperBuilder setAutoAssignRoles(Set<String> roles) {
        this.autoAssignRoles = roles;
        return this;
    }

    public GuildWrapperBuilder setLanguage(Language.Locales locale){
        this.locale = locale;
        return this;
    }

    public GuildWrapper build(){
        return new GuildWrapper(guildId, autoModGuild, welcome, polls, autoAssignRoles, selfAssignRoles, locale);
    }
}

@@ -199,62 +199,9 @@
 til.
-HashSet;%0Aimport java.util.Locale;%0Aimport java.util.Set
+*
 ;%0A%0Ap
@@ -371,18 +371,25 @@
 private 
-Se
+LinkedLis
 t%3CPoll%3E 
@@ -400,22 +400,25 @@
 s = new 
-HashSe
+LinkedLis
 t%3C%3E();%0A 
@@ -1036,18 +1036,25 @@
 etPolls(
-Se
+LinkedLis
 t%3CPoll%3E 

Use linked list instead of set