package j.r.a;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import j.e;
import j.n;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;

/* JADX INFO: compiled from: GsonConverterFactory.java */
/* JADX INFO: loaded from: classes.dex */
public final class a extends e.a {
    private final Gson a;

    private a(Gson gson) {
        this.a = gson;
    }

    public static a d() {
        return e(new Gson());
    }

    public static a e(Gson gson) {
        if (gson != null) {
            return new a(gson);
        }
        throw new NullPointerException("gson == null");
    }

    @Override // j.e.a
    public e<?, RequestBody> a(Type type, Annotation[] annotationArr, Annotation[] annotationArr2, n nVar) {
        return new b(this.a, this.a.getAdapter(TypeToken.get(type)));
    }

    @Override // j.e.a
    public e<ResponseBody, ?> b(Type type, Annotation[] annotationArr, n nVar) {
        return new c(this.a, this.a.getAdapter(TypeToken.get(type)));
    }
}
