Panagiotis Triantafyllou

minor fixes

......@@ -272,18 +272,10 @@ public class Coupon implements Parcelable, Serializable {
public RedeemMerchantDetails(JSONObject json) {
if (json != null) {
if (json.optJSONObject(IMG_PREVIEW) != null) {
this.imgPreview = json.optString(IMG_PREVIEW);
}
if (json.optJSONObject(NAME) != null) {
this.name = json.optString(NAME);
}
if (json.optJSONObject(UUID) != null) {
this.uuid = json.optString(UUID);
}
if (json.optJSONObject(REDEEMED_DATE) != null) {
this.redeemedDate = json.optString(REDEEMED_DATE);
}
this.imgPreview = json.isNull(IMG_PREVIEW) ? "" : json.optString(IMG_PREVIEW);
this.name = json.isNull(NAME) ? "" : json.optString(NAME);
this.uuid = json.isNull(UUID) ? "" : json.optString(UUID);
this.redeemedDate = json.isNull(REDEEMED_DATE) ? "" : json.optString(REDEEMED_DATE);
}
}
......
......@@ -82,7 +82,7 @@ public class MarketPassDetailsModel {
}
}
}
this.barcode = json.optString(BARCODE);
this.barcode = json.isNull(BARCODE) ? "" : json.optString(BARCODE);
this.totalDiscount = json.optDouble(TOTAL_DISCOUNT);
this.newOffers = json.optInt(NEW_OFFERS);
}
......@@ -153,9 +153,9 @@ public class MarketPassDetailsModel {
public Supermarkets(JSONObject json) {
if (json != null) {
this.logo = json.optString(LOGO);
this.name = json.optString(NAME);
this.uuid = json.optString(UUID);
this.logo = json.isNull(LOGO) ? "" : json.optString(LOGO);
this.name = json.isNull(NAME) ? "" : json.optString(NAME);
this.uuid = json.isNull(UUID) ? "" : json.optString(UUID);
}
}
......