package com.julienvey.trello.impl;

import com.julienvey.trello.domain.Argument;

public class TrelloUrl {

    public static final String API_URL = "https://api.trello.com/1";
    public static final String API_KEY_TOKEN_PARAM = "key={applicationKey}&token={userToken}";

    public static final String GET_BOARD = "/boards/{boardId}?";
    public static final String GET_BOARD_ACTIONS = "/boards/{boardId}/actions?";
    public static final String GET_BOARD_CARDS = "/boards/{boardId}/cards?";
    public static final String GET_BOARD_CARD = "/boards/{boardId}/cards/{cardId}?";
    public static final String GET_BOARD_CHECKLISTS = "/boards/{boardId}/checklists?";
    public static final String GET_BOARD_MEMBERS = "/boards/{boardId}/members?";
    public static final String GET_BOARD_MEMBER_CARDS = "/boards/{boardId}/members/{memberId}/cards?";
    public static final String GET_BOARD_LISTS = "/boards/{boardId}/lists?";
    public static final String GET_BOARD_MEMBERS_INVITED = "/boards/{boardId}/membersInvited?";
    public static final String GET_BOARD_MYPREFS = "/boards/{boardId}/myPrefs?";
    public static final String GET_BOARD_ORGANIZATION = "/boards/{boardId}/organization?";

    public static final String GET_ACTION = "/actions/{actionId}?";
    public static final String GET_ACTION_BOARD = "/actions/{actionId}/board?";

    public static final String CREATE_CARD = "/cards?pos=top&";
    public static final String GET_BASIC_MEMBER = "/members/{username}?fields=username,fullName&";
    public static final String ADD_LABEL_TO_CARD = "/cards/{cardId}/labels?";
    private static Argument[] args;

    private String baseUrl;

    private TrelloUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public static TrelloUrl createUrl(String baseUrl){
        return new TrelloUrl(baseUrl);
    }

    public TrelloUrl params(Argument... args){
        TrelloUrl.args = args;
        return this;
    }

    public String asString() {
        StringBuilder builder = new StringBuilder(API_URL);
        builder.append(baseUrl);
        builder.append(API_KEY_TOKEN_PARAM);
        for(Argument arg : args){
            builder.append("&");
            builder.append(arg.getArgName());
            builder.append("=");
            builder.append(arg.getArgValue());
        }
        return builder.toString();
    }
}
@@ -1577,24 +1577,25 @@
 %7D/labels?%22;%0A
+%0A
     private 
@@ -1598,33 +1598,24 @@
 ate 
-static Argument%5B%5D args
+String baseUrl
 ;%0A
-%0A
     
@@ -1622,30 +1622,36 @@
 private 
-String baseUrl
+Argument%5B%5D args = %7B%7D
 ;%0A%0A    p
@@ -1880,25 +1880,20 @@
         
-TrelloUrl
+this
 .args = 

Fix bug on TrelloUrl with the static variable args