package com.ifpdos.Utils.okhttp;

import com.google.gson.internal.C$Gson$Types;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import okhttp3.Request;
import okhttp3.Response;

/* JADX INFO: loaded from: classes.dex */
public abstract class BaseCallback<T> {
    public Type mType = getSuperclassTypeParameter(getClass());

    public abstract void onBeforeRequest(Request request);

    public abstract void onError(Response response, int i, Exception exc);

    public abstract void onFailure(Request request, Exception exc);

    public abstract void onResponse(Response response);

    public abstract void onSuccess(Response response, T t);

    static Type getSuperclassTypeParameter(Class<?> cls) {
        Type genericSuperclass = cls.getGenericSuperclass();
        if (genericSuperclass instanceof Class) {
            throw new RuntimeException("Missing type parameter.");
        }
        return C$Gson$Types.canonicalize(((ParameterizedType) genericSuperclass).getActualTypeArguments()[0]);
    }
}
