package com.wslfinc.cf.sdk.entities.additional;

/**
 *
 * @author Wsl_F
 */
public class ContestantResult {

    Contestant contestant;
    double seed;
    int nextRating;

    public ContestantResult(Contestant contestant, double seed, int nextRating) {
        this.contestant = contestant;
        this.seed = seed;
        this.nextRating = nextRating;
    }

    public double getSeed() {
        return seed;
    }

    public int getNextRating() {
        return nextRating;
    }

    public String getHandle() {
        return contestant.handle;
    }

    public int getRank() {
        return contestant.rank;
    }

    public int getPrevRating() {
        return contestant.prevRating;
    }
}

@@ -42,16 +42,169 @@
 ional;%0A%0A
+import static com.wslfinc.cf.sdk.Constants.*;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport org.json.JSONArray;%0Aimport org.json.JSONObject;%0A%0A
 /**%0A *%0A 
@@ -852,11 +852,1033 @@
 g;%0A    %7D
+%0A%0A    public JSONObject toJSON() %7B%0A        JSONObject json = new JSONObject();%0A        json.put(%22handle%22, contestant.handle);%0A        json.put(%22rank%22, contestant.rank);%0A        json.put(%22oldRating%22, contestant.prevRating);%0A        json.put(%22newRating%22, nextRating);%0A        json.put(%22seed%22, seed);%0A        return json;%0A    %7D%0A%0A    public JSONObject deltasToJSON() %7B%0A        JSONObject json = new JSONObject();%0A        json.put(%22handle%22, contestant.handle);%0A        int delta = nextRating - contestant.prevRating;%0A        json.put(%22delta%22, delta);%0A        return json;%0A    %7D%0A%0A    public static JSONObject toJSON(List%3CContestantResult%3E nextRating) %7B%0A        List%3CJSONObject%3E list = new ArrayList%3C%3E(nextRating.size());%0A        for (ContestantResult result : nextRating) %7B%0A            list.add(result.toJSON());%0A        %7D%0A%0A        JSONArray array = new JSONArray(list);%0A        JSONObject json = new JSONObject();%0A        json.put(%22status%22, SUCCESSFUL_STATUS);%0A        json.put(JSON_RESULTS, array);%0A%0A        return json;%0A    %7D
 %0A%7D%0A

add conversion to JSON