use of com.yandex.money.api.model.showcase.Showcase.Error in project yandex-money-sdk-java by yandex-money.
the class ShowcaseTypeAdapter method deserialize.
@Override
public Showcase deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject object = json.getAsJsonObject();
Group form = null;
JsonArray array = object.getAsJsonArray(MEMBER_FORM);
if (array != null) {
form = ListDelegate.deserialize(array, context);
}
List<AllowedMoneySource> moneySources = context.deserialize(object.get(MEMBER_MONEY_SOURCE), new TypeToken<List<AllowedMoneySource>>() {
}.getType());
List<Error> errors = ErrorTypeAdapter.getInstance().fromJson(object.getAsJsonArray(MEMBER_ERROR));
return new Showcase.Builder().setTitle(getString(object, MEMBER_TITLE)).setHiddenFields(getNotNullMap(object, MEMBER_HIDDEN_FIELDS)).setForm(form).setMoneySources(toEmptyListIfNull(moneySources)).setErrors(toEmptyListIfNull(errors)).create();
}
Aggregations