<commit_before>package edu.csh.chase.RestfulAPIConnector;


import edu.csh.chase.RestfulAPIConnector.JSONWrapper.JSONWrapper;

/**
 * Created by Chase on 1/27/14.
 */
public abstract class RestAPIListener {

    private JSONWrapper data;
    private String extra;
    private int statusCode;

    public abstract void success(JSONWrapper data, final int statusCode);

    public abstract void failure(final int statusCode);

    public void start() {
        if(statusCode >= 200 || statusCode <= 299){
            success(data, statusCode);
        }else{
            failure(statusCode);
        }
    }

    public void setData(JSONWrapper data) {
        this.data = data;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public String getExtra() {
        return extra;
    }

    public void setStatusCode(int statusCode) {<commit_msg>Added Javadocs for the success/failure methods. Gona rework on the listener works<commit_after>package edu.csh.chase.RestfulAPIConnector;


import edu.csh.chase.RestfulAPIConnector.JSONWrapper.JSONWrapper;

/**
 * Created by Chase on 1/27/14.
 */
public abstract class RestAPIListener {

    private JSONWrapper data;
    private String extra;
    private int statusCode;

    /**
     * The success function
     * This function is called when an request returns with a status code of 200 - 299
     *
     * @param data
     * @param statusCode
     */
    public abstract void success(JSONWrapper data, final int statusCode);

    /**
     * The failure function
     * This function is called when a request returns with a status code not between 200 and 299
     *
     * @param statusCode
     */
    public abstract void failure(final int statusCode);

    
    public void start() {
        if(statusCode >= 200 || statusCode <= 299){
            success(data, statusCode);
        }else{
            failure(statusCode);
        }
    }

    public void setData(JSONWrapper data) {
        this.data = data;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public String getExtra() {
        return extra;
    }

    public void setStatusCode(int statusCode) {
{'fraction_non_alphanumeric': 0.0827996340347667, 'fraction_numerical': 0.01555352241537054, 'mean_word_length': 2.4769475357710653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5218185', 'n_tokens_mistral': 640, 'n_tokens_neox': 596, 'n_words': 191}