use of com.yandex.money.api.model.AllowedMoneySource in project yandex-money-sdk-java by yandex-money.
the class ShowcaseProcessTest method getEmptyShowcase.
private static Showcase getEmptyShowcase() {
Group.Builder builder = new Group.Builder();
Group group = builder.create();
return new Showcase.Builder().setTitle("foo").setErrors(Collections.<Showcase.Error>emptyList()).setForm(group).setHiddenFields(Collections.<String, String>emptyMap()).setMoneySources(Collections.<AllowedMoneySource>emptyList()).create();
}
use of com.yandex.money.api.model.AllowedMoneySource 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