Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/mato/MapiVolleyRequest.java
package it.reyboz.bustorino.backend.mato; | package it.reyboz.bustorino.backend.mato; | ||||
import androidx.annotation.Nullable; | import androidx.annotation.Nullable; | ||||
import com.android.volley.AuthFailureError; | import com.android.volley.AuthFailureError; | ||||
import com.android.volley.Request; | import com.android.volley.Request; | ||||
import com.android.volley.Response; | import com.android.volley.Response; | ||||
import java.util.Map; | import java.util.Map; | ||||
public abstract class MapiVolleyRequest<T> extends Request<T> { | public abstract class MapiVolleyRequest<T> extends Request<T> { | ||||
private static final String API_URL="https://mapi.5t.torino.it/routing/v1/routers/mat/index/graphql"; | private static final String API_URL="https://mapi.5t.torino.it/routing/v1/routers/mat/index/graphql"; | ||||
protected final Response.Listener<T> listener; | protected final Response.Listener<T> listener; | ||||
private final MatoAPIFetcher.QueryType type; | protected final MatoQueries.QueryType type; | ||||
public MapiVolleyRequest( | public MapiVolleyRequest( | ||||
MatoAPIFetcher.QueryType type, | MatoQueries.QueryType type, | ||||
Response.Listener<T> listener, | Response.Listener<T> listener, | ||||
@Nullable Response.ErrorListener errorListener) { | @Nullable Response.ErrorListener errorListener) { | ||||
super(Method.POST, API_URL, errorListener); | super(Method.POST, API_URL, errorListener); | ||||
this.type = type; | this.type = type; | ||||
this.listener = listener; | this.listener = listener; | ||||
} | } | ||||
Show All 12 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register