package com.afrozaar.wordpress.wpapi.v2.util;

import org.yaml.snakeyaml.Yaml;

import java.io.InputStream;

public class ClientConfig {

    Wordpress wordpress;
    boolean debug;

    public ClientConfig() {
    }

    public boolean isDebug() {
        return debug;
    }

    public void setDebug(boolean debug) {
        this.debug = debug;
    }

    public Wordpress getWordpress() {
        return wordpress;
    }

    public void setWordpress(Wordpress wordpress) {
        this.wordpress = wordpress;
    }

    public static ClientConfig load(InputStream inputStream) {
        return new Yaml().loadAs(inputStream, ClientConfig.class);
    }

    public static class Wordpress {
        String username;
        String password;
        String baseUrl;

        public Wordpress() {
        }

        public String getBaseUrl() {
            return baseUrl;
        }

        public void setBaseUrl(String baseUrl) {
            this.baseUrl = baseUrl;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }
    }
}

@@ -203,32 +203,166 @@
 nfig() %7B%0A    %7D%0A%0A
+    private ClientConfig(boolean debug, Wordpress wordpress) %7B%0A        this.debug = debug;%0A        this.wordpress = wordpress;%0A    %7D%0A%0A
     public boole
@@ -807,129 +807,515 @@
 tic 
-class Wordpress %7B%0A        String username;%0A        String password;%0A        String baseUrl;%0A%0A        public Wordpress() %7B
+ClientConfig of(String baseUrl, String username, String password, boolean debug) %7B%0A        return new ClientConfig(debug, new Wordpress(baseUrl, username, password));%0A    %7D%0A%0A    public static class Wordpress %7B%0A        String username;%0A        String password;%0A        String baseUrl;%0A%0A        Wordpress() %7B%0A        %7D%0A%0A        private Wordpress(String baseUrl, String username, String password) %7B%0A            this.baseUrl = baseUrl;%0A            this.password = password;%0A            this.username = username;
 %0A   

Add convenience methods to get a client config.