<commit_before>package eu.steakholders.bingo.api;

import android.content.Context;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.RequestFuture;
import com.android.volley.toolbox.Volley;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public abstract class ModelGetter {
    protected Context context;
    protected static RequestQueue queue = null;
    protected static String API_URL = "https://steakholders.eu/api/v1/";
    protected static String API_FORMAT = "/?format=json";

    public ModelGetter(Context c) {
        context = c;
        /*
        request(
                "https://steakholders.eu/api/v1/place/?format=json",
                null,
                new Response.Listener<JSONArray>() {
                    @Override
                    public void onResponse(JSONArray response) {
                        System.out.println("Response: " + response.toString());
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        // TODO Auto-generated method stub
                        System.out.println(error);
                    }
                });*/
    }

    protected ModelGetter() {
    }


    public static void getById(Context context, String url, int id, Response.Listener success , Response.ErrorListener error){
        request(context, Request.Method.GET, API_URL + url + "/" + id + API_FORMAT, null, success, error);
    }

    public static void getAll(Context context,String url, Response.Listener success , Response.ErrorListener error){
        requestAll(context, Request.Method.GET, API_URL + url + API_FORMAT, null, success, error);
    }

    protected static void request(Context context,int method, String url, JSONObject payload, Response.Listener success , Response.ErrorListener error){
        if(queue == null){
            queue = Volley.newRequestQueue(context);
        }<commit_msg>Made ModelGetter getById and getAll protected<commit_after>package eu.steakholders.bingo.api;

import android.content.Context;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.RequestFuture;
import com.android.volley.toolbox.Volley;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public abstract class ModelGetter {
    protected Context context;
    protected static RequestQueue queue = null;
    protected static String API_URL = "https://steakholders.eu/api/v1/";
    protected static String API_FORMAT = "/?format=json";

    public ModelGetter(Context c) {
        context = c;
        /*
        request(
                "https://steakholders.eu/api/v1/place/?format=json",
                null,
                new Response.Listener<JSONArray>() {
                    @Override
                    public void onResponse(JSONArray response) {
                        System.out.println("Response: " + response.toString());
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        // TODO Auto-generated method stub
                        System.out.println(error);
                    }
                });*/
    }

    protected ModelGetter() {
    }


    protected static void getById(Context context, String url, int id, Response.Listener success , Response.ErrorListener error){
        request(context, Request.Method.GET, API_URL + url + "/" + id + API_FORMAT, null, success, error);
    }

    protected static void getAll(Context context,String url, Response.Listener success , Response.ErrorListener error){
        requestAll(context, Request.Method.GET, API_URL + url + API_FORMAT, null, success, error);
    }

    protected static void request(Context context,int method, String url, JSONObject payload, Response.Listener success , Response.ErrorListener error){
        if(queue == null){
            queue = Volley.newRequestQueue(context);
        }
{'fraction_non_alphanumeric': 0.09621993127147767, 'fraction_numerical': 0.000859106529209622, 'mean_word_length': 2.4445266272189348, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '3438705', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1176, 'n_words': 283}