package bee_core.processor;

/**
 * 爬虫的配置类
 * data 2017-03-23   01:55
 * E-mail   sis.nonacosa@gmail.com
 * @author sis.nonacosa
 */
public class Setting {

    private String domain;

    private String userAgent;

    private String userName;

    private String password;

    private String startUrl;

    /**
     * 个性化配置类入口返回配置对象,省去了new Setting()的步骤
     * @return
     */
    public static Setting create() {
        return new Setting();
    }
    /**
     * 设置一个作用域
     * @param domain
     * @return
     */
    public Setting setDomain(String domain) {
        this.domain = domain;
        return this ;
    }

    /**
     * 设置一个userAgent
     * @param userAgent
     * @return
     */
    public Setting setUserAgent(String userAgent) {
        this.userAgent = userAgent;
        return this;
    }

    /**
     * 设置一个登录账号(若有需要)
     * @param userName
     * @return
     */
    public Setting setUserName(String userName) {
        this.userName = userName;
        return this;
    }

    /**
     * 设置一个登录密码(若有需要)
     * @param password
     * @return
     */
    public Setting setPassword(String password) {
        this.password = password;
        return this;
    }

    /**
     * 获取已经设置的作用域
     * @return
     */
    public String getDomain() {
        return domain;
    }

    /**
     * 获取已经设置的userAgent
     * @return
     */
    public String getUserAgent() {
        return userAgent;
    }

    /**
     * 获取已经设置的账户
     * @return
     */
    public String getUserName() {
        return userName;
    }

    /**
     * 获取已经设置的密码
     * @return
     */
    public String getPassword() {
        return password;
    }

    public String getStartUrl() {
        return startUrl;
    }

    public Setting setStartUrl(String startUrl) {
        this.startUrl = startUrl;
        return this;
    }


}

@@ -22,16 +22,72 @@
 essor;%0A%0A
+%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0A%0A
 /**%0A * %E7%88%AC
@@ -355,16 +355,130 @@
 rtUrl;%0A%0A
+    private Map%3CString,String%3E cookies = new LinkedHashMap%3CString, String%3E();//todo Collections.synchronizedMap?%0A%0A
     /**%0A
@@ -1996,10 +1996,206 @@
     %7D%0A%0A%0A
+    public Map%3CString, String%3E getCookies() %7B%0A        return cookies;%0A    %7D%0A%0A    public Setting setCookies(String key, String value) %7B%0A        cookies.put(key,value);%0A        return this;%0A    %7D%0A%0A%0A
 %7D%0A

add linkedHashMap cookies parameter