package com.discord.restapi; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import d0.z.d.m; import i0.f0.a.a; import i0.f0.a.b; import i0.h; import i0.z; import java.lang.annotation.Annotation; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Objects; import okhttp3.RequestBody; /* compiled from: PayloadJSON.kt */ public final class PayloadJSON { private final T data; /* compiled from: PayloadJSON.kt */ public static final class ConverterFactory extends h.a { private final a gsonConverterFactory; /* compiled from: PayloadJSON.kt */ public static final class RequestBodyConverter implements h, RequestBody> { private final h gsonRequestBodyConverter; public RequestBodyConverter(h hVar) { m.checkNotNullParameter(hVar, "gsonRequestBodyConverter"); this.gsonRequestBodyConverter = hVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // i0.h public /* bridge */ /* synthetic */ RequestBody convert(Object obj) { return convert((PayloadJSON) ((PayloadJSON) obj)); } /* JADX DEBUG: Multi-variable search result rejected for r0v1, resolved type: i0.h */ /* JADX WARN: Multi-variable type inference failed */ public RequestBody convert(PayloadJSON payloadJSON) { m.checkNotNullParameter(payloadJSON, "value"); return (RequestBody) this.gsonRequestBodyConverter.convert(PayloadJSON.access$getData$p(payloadJSON)); } } public ConverterFactory(Gson gson) { m.checkNotNullParameter(gson, "gson"); Objects.requireNonNull(gson, "gson == null"); this.gsonConverterFactory = new a(gson); } @Override // i0.h.a public h requestBodyConverter(Type type, Annotation[] annotationArr, Annotation[] annotationArr2, z zVar) { m.checkNotNullParameter(type, "type"); m.checkNotNullParameter(annotationArr, "parameterAnnotations"); m.checkNotNullParameter(annotationArr2, "methodAnnotations"); m.checkNotNullParameter(zVar, "retrofit"); if (!(type instanceof ParameterizedType)) { type = null; } ParameterizedType parameterizedType = (ParameterizedType) type; if (parameterizedType == null || (!m.areEqual(parameterizedType.getRawType(), PayloadJSON.class))) { return null; } Type type2 = parameterizedType.getActualTypeArguments()[0]; a aVar = this.gsonConverterFactory; return new RequestBodyConverter(new b(aVar.a, aVar.a.h(TypeToken.get(type2)))); } } public PayloadJSON(T t) { this.data = t; } public static final /* synthetic */ Object access$getData$p(PayloadJSON payloadJSON) { return payloadJSON.data; } private final T component1() { return this.data; } /* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.restapi.PayloadJSON */ /* JADX WARN: Multi-variable type inference failed */ public static /* synthetic */ PayloadJSON copy$default(PayloadJSON payloadJSON, Object obj, int i, Object obj2) { if ((i & 1) != 0) { obj = payloadJSON.data; } return payloadJSON.copy(obj); } public final PayloadJSON copy(T t) { return new PayloadJSON<>(t); } public boolean equals(Object obj) { if (this != obj) { return (obj instanceof PayloadJSON) && m.areEqual(this.data, ((PayloadJSON) obj).data); } return true; } public int hashCode() { T t = this.data; if (t != null) { return t.hashCode(); } return 0; } public String toString() { StringBuilder L = c.d.b.a.a.L("PayloadJSON(data="); L.append((Object) this.data); L.append(")"); return L.toString(); } }