Blame | Last modification | View Log | RSS feed
package in.shop2020.datalogger.event;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import in.shop2020.datalogger.EventType;public class CouponApplied extends Event {private String couponCode;public CouponApplied(String[] eventFileds) {super(eventFileds);couponCode = eventFileds[4].trim();}public CouponApplied(EventType eType, String sessionId, long userId, String email, String[] logData) {super(eType, sessionId, userId, email);couponCode = logData[4].trim();}public String toString() {StringBuilder sb = new StringBuilder();sb.append(eventType.name() + ", ");sb.append("userEmail : " + userEmail);sb.append(" couponCode : " + this.couponCode);sb.append(" time : " + time);sb.append(" session : " + sessionId);return sb.toString();}@Overridepublic JSONObject getLogDataInJson() {JSONObject logDataInJson = new JSONObject();try {logDataInJson.put("couponCode", this.couponCode);} catch (JSONException e) {e.printStackTrace();}return logDataInJson;}public String getCouponCode() {return this.couponCode;}public void setCouponCode(String couponCode) {this.couponCode = couponCode;}}