44 lines
1.7 KiB
Java
44 lines
1.7 KiB
Java
package o;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.JsonArray;
|
|
import com.google.gson.JsonDeserializationContext;
|
|
import com.google.gson.JsonDeserializer;
|
|
import com.google.gson.JsonElement;
|
|
import com.google.gson.JsonNull;
|
|
import com.google.gson.JsonObject;
|
|
import com.google.gson.JsonParseException;
|
|
import java.lang.reflect.Type;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class XjK {
|
|
|
|
/* loaded from: classes.dex */
|
|
public static final class LWm implements JsonDeserializer {
|
|
private Gson e;
|
|
|
|
public LWm(Gson gson) {
|
|
this.e = gson;
|
|
}
|
|
|
|
@Override // com.google.gson.JsonDeserializer
|
|
public final Object deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
|
|
if (jsonElement.isJsonObject()) {
|
|
JsonObject asJsonObject = jsonElement.getAsJsonObject();
|
|
if (asJsonObject.has("creditCardCategories") && !(asJsonObject.get("creditCardCategories") instanceof JsonNull)) {
|
|
JsonArray asJsonArray = asJsonObject.getAsJsonArray("creditCardCategories");
|
|
JsonArray jsonArray = new JsonArray();
|
|
JsonObject jsonObject = new JsonObject();
|
|
for (int i = 0; i < asJsonArray.size(); i++) {
|
|
jsonObject.addProperty("creditCardCategory", asJsonArray.get(i).getAsString());
|
|
}
|
|
asJsonObject.add("creditCardCategoryList", jsonArray);
|
|
asJsonObject.remove("creditCardCategories");
|
|
}
|
|
return this.e.fromJson(asJsonObject, type);
|
|
}
|
|
return this.e.fromJson(jsonElement, type);
|
|
}
|
|
}
|
|
}
|