public static Coupon newCoupon(String batchId, String id, Integer fee){ Coupon c = new Coupon(); c.batchId = batchId; c.id = id; c.fee = fee; return c; }
public static Coupon newCoupon(String batchId, String id, Integer fee){ Coupon c = new Coupon(); c.batchId = batchId; c.id = id; c.fee = fee; return c; }
couponReader: function () { var self = this , coupon = new Coupon(); coupon.fetch({success: function (model, response) { Cart.add(model); }); }
List<Coupon> couponsList = new ArrayList<>(); JSONArray coupons = json .getJSONArray(TAG_COUPONS); // JSON Array for (JSONObject coupon : (Iterable<JSONObject>) coupons) { String text = coupon.get("text"); couponsList.add(new Coupon(text)); }
final GenericRawResults<Coupon> results = couponDao.queryRaw("SELECT " + "product_table.product_id AS id, " + "product_table.store_id AS storeId " + " FROM coupon_table " + "JOIN product_table ON coupon_table.store_id = product_table.store_id " + "WHERE product_table.store_id = 1", new RawRowMapper<Coupon>() { @Override public Coupon mapRow(String[] columnNames, String[] resultColumns) throws SQLException { final Integer productId = Integer.parseInt(resultColumns[0]); final Integer storeId = Integer.parseInt(resultColumns[1]); final Product product = new Product(); product.setId(productId); product.setStoreId(storeId); final Coupon coupon = new Coupon(); coupon.setProduct(product); return coupon; } }); final Coupon coupon = results.getResults().get(0); final Product product = coupon.getProduct(); System.out.println("Product id is " + product.getId() + " , Store id is " + product.getStoreId());
Coupon coupon = new Coupon(jsonObject.getString(KEY_TITLE), jsonObject.getString(KEY_NAME), jsonObject.getString(KEY_CODE),
Coupon newCoupon = new Coupon(sc.next(), sc.nextDouble()); coupons.add(i, newCoupon); sc.nextLine();