
com.sailthru.client.params.PurchaseItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sailthru-java-client Show documentation
Show all versions of sailthru-java-client Show documentation
Java client library for Sailthru API
package com.sailthru.client.params;
import com.google.gson.Gson;
import com.sailthru.client.SailthruUtil;
import com.sailthru.client.handler.JsonHandler;
import java.util.Map;
import java.util.List;
/**
*
* @author Prajwal Tuladhar
*/
public class PurchaseItem {
protected String qty;
protected String title;
protected String price;
protected String id;
protected String url;
protected List tags;
protected Map vars;
public PurchaseItem(Integer qty, String title, Integer price, String id, String url) {
this.qty = qty.toString();
this.title = title;
this.price = price.toString();
this.id = id;
this.url = url;
}
public PurchaseItem setTags(List tags) {
this.tags = tags;
return this;
}
public PurchaseItem setVars(Map vars) {
this.vars = vars;
return this;
}
public Map toHashMap() {
Gson gson = SailthruUtil.createGson();
String json = gson.toJson(this);
JsonHandler handler = new JsonHandler();
return (Map)handler.parseResponse(json);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy