package org.rmatil.sync.core.init;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.rmatil.sync.core.model.RemoteClientLocation;

public class ApplicationConfig {

    protected static Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();

    protected String               userName;
    protected String               password;
    protected String               salt;
    protected int                  defaultPort;
    protected String               publicKeyPath;
    protected String               privateKeyPath;
    protected RemoteClientLocation defaultBootstrapLocation;

    public ApplicationConfig(String userName, String password, String salt, int defaultPort, String publicKeyPath, String privateKeyPath, RemoteClientLocation defaultBootstrapLocation) {
        this.userName = userName;
        this.password = password;
        this.salt = salt;
        this.defaultPort = defaultPort;
        this.publicKeyPath = publicKeyPath;
        this.privateKeyPath = privateKeyPath;
        this.defaultBootstrapLocation = defaultBootstrapLocation;
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }

    public String getSalt() {
        return salt;
    }

    public int getDefaultPort() {
        return defaultPort;
    }

    public String getPublicKeyPath() {
        return publicKeyPath;
    }

    public String getPrivateKeyPath() {
        return privateKeyPath;
    }

    public RemoteClientLocation getDefaultBootstrapLocation() {
        return defaultBootstrapLocation;
    }

    /**
     * Creates a JSON representation of this application config
     *
     * @return
     */
    public String toJson() {
        return gson.toJson(this, ApplicationConfig.class);
    }

    /**
     * Creates an app config from its JSON representation
     *
     * @param json The json string
     *
     * @return The config created of it
     */
    public static ApplicationConfig fromJson(String json) {
        return gson.fromJson(json, ApplicationConfig.class);
    }
}

@@ -1191,422 +1191,1153 @@
 lic 
-String getPassword() %7B%0A        return password;%0A    %7D%0A%0A    public String getSalt() %7B%0A        return salt;%0A    %7D%0A%0A    public int getDefaultPort() %7B%0A        return defaultPort;%0A    %7D%0A%0A    public String getPublicKeyPath() %7B%0A        return publicKeyPath;%0A    %7D%0A%0A    public String getPrivateKeyPath() %7B%0A        return privateKeyPath;%0A    %7D%0A%0A    public RemoteClientLocation getDefaultBootstrapLocation() %7B%0A        return
+void setUserName(String userName) %7B%0A        this.userName = userName;%0A    %7D%0A%0A    public String getPassword() %7B%0A        return password;%0A    %7D%0A%0A    public void setPassword(String password) %7B%0A        this.password = password;%0A    %7D%0A%0A    public String getSalt() %7B%0A        return salt;%0A    %7D%0A%0A    public void setSalt(String salt) %7B%0A        this.salt = salt;%0A    %7D%0A%0A    public int getDefaultPort() %7B%0A        return defaultPort;%0A    %7D%0A%0A    public void setDefaultPort(int defaultPort) %7B%0A        this.defaultPort = defaultPort;%0A    %7D%0A%0A    public String getPublicKeyPath() %7B%0A        return publicKeyPath;%0A    %7D%0A%0A    public void setPublicKeyPath(String publicKeyPath) %7B%0A        this.publicKeyPath = publicKeyPath;%0A    %7D%0A%0A    public String getPrivateKeyPath() %7B%0A        return privateKeyPath;%0A    %7D%0A%0A    public void setPrivateKeyPath(String privateKeyPath) %7B%0A        this.privateKeyPath = privateKeyPath;%0A    %7D%0A%0A    public RemoteClientLocation getDefaultBootstrapLocation() %7B%0A        return defaultBootstrapLocation;%0A    %7D%0A%0A    public void setDefaultBootstrapLocation(RemoteClientLocation defaultBootstrapLocation) %7B%0A        this.defaultBootstrapLocation =
  def

Add setter for application config values