117 lines
4.5 KiB
Java
117 lines
4.5 KiB
Java
package com.discord.api.report;
|
|
|
|
import com.discord.api.report.ReportNodeBottomButton;
|
|
import com.google.gson.TypeAdapter;
|
|
import com.google.gson.stream.JsonReader;
|
|
import com.google.gson.stream.JsonToken;
|
|
import com.google.gson.stream.JsonWriter;
|
|
import d0.y.b;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.Unit;
|
|
/* compiled from: InAppReportsMenu.kt */
|
|
public final class ReportNodeBottomButtonTypeAdapter extends TypeAdapter<ReportNodeBottomButton> {
|
|
|
|
public final /* synthetic */ class WhenMappings {
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
|
|
static {
|
|
JsonToken.values();
|
|
int[] iArr = new int[10];
|
|
$EnumSwitchMapping$0 = iArr;
|
|
iArr[6] = 1;
|
|
iArr[5] = 2;
|
|
}
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
@Override // com.google.gson.TypeAdapter
|
|
public ReportNodeBottomButton read(JsonReader jsonReader) {
|
|
m.checkNotNullParameter(jsonReader, "reader");
|
|
if (jsonReader.N() == JsonToken.NULL) {
|
|
jsonReader.U();
|
|
return null;
|
|
}
|
|
jsonReader.b();
|
|
String str = "";
|
|
Object obj = str;
|
|
while (jsonReader.r()) {
|
|
String C = jsonReader.C();
|
|
if (C != null) {
|
|
int hashCode = C.hashCode();
|
|
if (hashCode != -880905839) {
|
|
if (hashCode == 3575610 && C.equals("type")) {
|
|
str = jsonReader.K();
|
|
m.checkNotNullExpressionValue(str, "reader.nextString()");
|
|
}
|
|
} else if (C.equals("target")) {
|
|
JsonToken N = jsonReader.N();
|
|
if (N != null) {
|
|
int ordinal = N.ordinal();
|
|
if (ordinal == 5) {
|
|
obj = jsonReader.K();
|
|
} else if (ordinal == 6) {
|
|
obj = Integer.valueOf(jsonReader.z());
|
|
}
|
|
m.checkNotNullExpressionValue(obj, "when (reader.peek()) {\n …der.skipValue()\n }");
|
|
}
|
|
jsonReader.U();
|
|
obj = Unit.a;
|
|
m.checkNotNullExpressionValue(obj, "when (reader.peek()) {\n …der.skipValue()\n }");
|
|
}
|
|
}
|
|
jsonReader.U();
|
|
}
|
|
jsonReader.f();
|
|
switch (str.hashCode()) {
|
|
case -1367724422:
|
|
if (str.equals("cancel")) {
|
|
return ReportNodeBottomButton.Cancel.INSTANCE;
|
|
}
|
|
return null;
|
|
case -891535336:
|
|
if (str.equals("submit")) {
|
|
return ReportNodeBottomButton.Submit.INSTANCE;
|
|
}
|
|
return null;
|
|
case 3089282:
|
|
if (str.equals("done")) {
|
|
return ReportNodeBottomButton.Done.INSTANCE;
|
|
}
|
|
return null;
|
|
case 3377907:
|
|
if (!str.equals("next")) {
|
|
return null;
|
|
}
|
|
Objects.requireNonNull(obj, "null cannot be cast to non-null type kotlin.Int");
|
|
return new ReportNodeBottomButton.Next(((Integer) obj).intValue());
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [com.google.gson.stream.JsonWriter, java.lang.Object] */
|
|
/* JADX WARNING: Code restructure failed: missing block: B:13:0x0049, code lost:
|
|
r0 = move-exception;
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:14:0x004a, code lost:
|
|
d0.y.b.closeFinally(r3, r4);
|
|
*/
|
|
/* JADX WARNING: Code restructure failed: missing block: B:15:0x004d, code lost:
|
|
throw r0;
|
|
*/
|
|
@Override // com.google.gson.TypeAdapter
|
|
public void write(JsonWriter jsonWriter, ReportNodeBottomButton reportNodeBottomButton) {
|
|
ReportNodeBottomButton reportNodeBottomButton2 = reportNodeBottomButton;
|
|
m.checkNotNullParameter(jsonWriter, "out");
|
|
if (reportNodeBottomButton2 == null) {
|
|
jsonWriter.s();
|
|
return;
|
|
}
|
|
JsonWriter p = jsonWriter.c().p("type").H(reportNodeBottomButton2.a()).p("target");
|
|
JsonWriter G = reportNodeBottomButton2 instanceof ReportNodeBottomButton.Next ? p.G(Integer.valueOf(((ReportNodeBottomButton.Next) reportNodeBottomButton2).b())) : p.s();
|
|
b.closeFinally(p, null);
|
|
G.f();
|
|
}
|
|
}
|