discord-jadx/app/src/main/java/com/discord/models/thread/dto/ModelThreadListSync$Parser$...

132 lines
6.2 KiB
Java

package com.discord.models.thread.dto;
import com.discord.api.channel.Channel;
import com.discord.api.message.Message;
import com.discord.api.thread.ThreadMember;
import com.discord.models.deserialization.gson.InboundGatewayGsonParser;
import com.discord.models.domain.Model;
import com.google.gson.stream.JsonToken;
import d0.z.d.m;
import kotlin.jvm.internal.Ref$LongRef;
import kotlin.jvm.internal.Ref$ObjectRef;
import rx.functions.Action1;
/* compiled from: ModelThreadListSync.kt */
public final class ModelThreadListSync$Parser$parse$1<T> implements Action1<String> {
public final /* synthetic */ Ref$LongRef $guildId;
public final /* synthetic */ Ref$ObjectRef $members;
public final /* synthetic */ Ref$ObjectRef $mostRecentMessages;
public final /* synthetic */ Model.JsonReader $reader;
public final /* synthetic */ Ref$ObjectRef $threads;
/* compiled from: ModelThreadListSync.kt */
/* renamed from: com.discord.models.thread.dto.ModelThreadListSync$Parser$parse$1$1 reason: invalid class name */
public static final class AnonymousClass1<T> implements Model.JsonReader.ItemFactory<Channel> {
public final /* synthetic */ ModelThreadListSync$Parser$parse$1 this$0;
public AnonymousClass1(ModelThreadListSync$Parser$parse$1 modelThreadListSync$Parser$parse$1) {
this.this$0 = modelThreadListSync$Parser$parse$1;
}
@Override // com.discord.models.domain.Model.JsonReader.ItemFactory
public final Channel get() {
return (Channel) InboundGatewayGsonParser.fromJson(this.this$0.$reader, Channel.class);
}
}
/* compiled from: ModelThreadListSync.kt */
/* renamed from: com.discord.models.thread.dto.ModelThreadListSync$Parser$parse$1$2 reason: invalid class name */
public static final class AnonymousClass2<T> implements Model.JsonReader.ItemFactory<ThreadMember> {
public final /* synthetic */ ModelThreadListSync$Parser$parse$1 this$0;
public AnonymousClass2(ModelThreadListSync$Parser$parse$1 modelThreadListSync$Parser$parse$1) {
this.this$0 = modelThreadListSync$Parser$parse$1;
}
@Override // com.discord.models.domain.Model.JsonReader.ItemFactory
public final ThreadMember get() {
return (ThreadMember) InboundGatewayGsonParser.fromJson(this.this$0.$reader, ThreadMember.class);
}
}
/* compiled from: ModelThreadListSync.kt */
/* renamed from: com.discord.models.thread.dto.ModelThreadListSync$Parser$parse$1$3 reason: invalid class name */
public static final class AnonymousClass3<T> implements Action1<String> {
public final /* synthetic */ ModelThreadListSync$Parser$parse$1 this$0;
public AnonymousClass3(ModelThreadListSync$Parser$parse$1 modelThreadListSync$Parser$parse$1) {
this.this$0 = modelThreadListSync$Parser$parse$1;
}
public final void call(String str) {
ThreadMember threadMember = (ThreadMember) InboundGatewayGsonParser.fromJson(this.this$0.$reader, ThreadMember.class);
m.checkNotNullExpressionValue(str, "threadId");
this.this$0.$members.element.add(new ThreadMember(Long.parseLong(str), threadMember.d(), threadMember.a(), threadMember.c()));
}
}
/* compiled from: ModelThreadListSync.kt */
/* renamed from: com.discord.models.thread.dto.ModelThreadListSync$Parser$parse$1$4 reason: invalid class name */
public static final class AnonymousClass4<T> implements Model.JsonReader.ItemFactory<Message> {
public final /* synthetic */ ModelThreadListSync$Parser$parse$1 this$0;
public AnonymousClass4(ModelThreadListSync$Parser$parse$1 modelThreadListSync$Parser$parse$1) {
this.this$0 = modelThreadListSync$Parser$parse$1;
}
@Override // com.discord.models.domain.Model.JsonReader.ItemFactory
public final Message get() {
return (Message) InboundGatewayGsonParser.fromJson(this.this$0.$reader, Message.class);
}
}
public ModelThreadListSync$Parser$parse$1(Ref$LongRef ref$LongRef, Model.JsonReader jsonReader, Ref$ObjectRef ref$ObjectRef, Ref$ObjectRef ref$ObjectRef2, Ref$ObjectRef ref$ObjectRef3) {
this.$guildId = ref$LongRef;
this.$reader = jsonReader;
this.$threads = ref$ObjectRef;
this.$members = ref$ObjectRef2;
this.$mostRecentMessages = ref$ObjectRef3;
}
public final void call(String str) {
if (str != null) {
switch (str.hashCode()) {
case -1337936983:
if (str.equals("threads")) {
this.$threads.element = (T) this.$reader.nextList(new AnonymousClass1(this));
return;
}
break;
case -1306538777:
if (str.equals("guild_id")) {
Ref$LongRef ref$LongRef = this.$guildId;
Long nextLongOrNull = this.$reader.nextLongOrNull();
m.checkNotNull(nextLongOrNull);
ref$LongRef.element = nextLongOrNull.longValue();
return;
}
break;
case 948881689:
if (str.equals("members")) {
if (this.$reader.peek() == JsonToken.BEGIN_ARRAY) {
Ref$ObjectRef ref$ObjectRef = this.$members;
T t = (T) this.$reader.nextList(new AnonymousClass2(this));
m.checkNotNullExpressionValue(t, "reader.nextList { Inboun…readMember::class.java) }");
ref$ObjectRef.element = t;
return;
}
this.$reader.nextObject(new AnonymousClass3(this));
return;
}
break;
case 1472794100:
if (str.equals("most_recent_messages")) {
this.$mostRecentMessages.element = (T) this.$reader.nextList(new AnonymousClass4(this));
return;
}
break;
}
}
this.$reader.skipValue();
}
}