class SW360ClientConfig {

    public static SW360ClientConfig createConfig(String restURL, String authURL, String user,
                                                 String password, String clientId, String clientPassword,
                                                 String token, HttpClient httpClient, ObjectMapper mapper) {
        if(!StringUtils.isEmpty(token)){
            return new SW360ClientConfig(
                    URI.create(stripTrailingSeparator(Validate.notEmpty(restURL, "Undefined REST URL"))),
                    stripTrailingSeparator(Validate.notEmpty(authURL, "Undefined authentication URL")),
                    user,
                    password,
                    Validate.notEmpty(clientId, "Undefined client ID"),
                    Validate.notEmpty(clientPassword, "Undefined client password"),
                    Validate.notEmpty(token, "Undefined token"),
                    Validate.notNull(httpClient),
                    Validate.notNull(mapper));
        }
        return new SW360ClientConfig(
                URI.create(stripTrailingSeparator(Validate.notEmpty(restURL, "Undefined REST URL"))),
                stripTrailingSeparator(Validate.notEmpty(authURL, "Undefined authentication URL")),
                Validate.notEmpty(user, "Undefined user"),
                Validate.notEmpty(password, "Undefined password"),
                Validate.notEmpty(clientId, "Undefined client ID"),
                Validate.notEmpty(clientPassword, "Undefined client password"),
                token,
                Validate.notNull(httpClient),
                Validate.notNull(mapper));
    }

    private  SW360ClientConfig(URI baseURI, String authURL, String user, String password, String clientId,
                              String clientPassword, String token, HttpClient httpClient, ObjectMapper objectMapper);

}