discord-jadx/app/src/main/java/com/discord/api/friendsuggestions/AllowedInSuggestionsTypeAda...

43 lines
1.8 KiB
Java

package com.discord.api.friendsuggestions;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import d0.z.d.m;
/* compiled from: AllowedInSuggestionsType.kt */
public final class AllowedInSuggestionsTypeAdapter extends TypeAdapter<AllowedInSuggestionsType> {
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // com.google.gson.TypeAdapter
public AllowedInSuggestionsType read(JsonReader jsonReader) {
AllowedInSuggestionsType allowedInSuggestionsType;
m.checkNotNullParameter(jsonReader, "in");
int z2 = jsonReader.z();
AllowedInSuggestionsType[] values = AllowedInSuggestionsType.values();
int i = 0;
while (true) {
if (i >= 3) {
allowedInSuggestionsType = null;
break;
}
allowedInSuggestionsType = values[i];
if (allowedInSuggestionsType.getApiValue() == z2) {
break;
}
i++;
}
return allowedInSuggestionsType != null ? allowedInSuggestionsType : AllowedInSuggestionsType.DISABLED;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [com.google.gson.stream.JsonWriter, java.lang.Object] */
@Override // com.google.gson.TypeAdapter
public void write(JsonWriter jsonWriter, AllowedInSuggestionsType allowedInSuggestionsType) {
AllowedInSuggestionsType allowedInSuggestionsType2 = allowedInSuggestionsType;
m.checkNotNullParameter(jsonWriter, "out");
if (allowedInSuggestionsType2 != null) {
jsonWriter.G(Integer.valueOf(allowedInSuggestionsType2.getApiValue()));
} else {
jsonWriter.s();
}
}
}