com.egzosn.pay.common.bean.outbuilder.JsonBuilder Maven / Gradle / Ivy
package com.egzosn.pay.common.bean.outbuilder;
import com.alibaba.fastjson.JSONObject;
import com.egzosn.pay.common.bean.PayOutMessage;
/**
* @author: egan
*
* email [email protected]
* date 2017/1/13 14:30
*
*/
public class JsonBuilder extends BaseBuilder{
JSONObject json = null;
public JsonBuilder(JSONObject json) {
this.json = json;
}
public JsonBuilder content(String key, Object content) {
this.json.put(key, content);
return this;
}
public JSONObject getJson() {
return json;
}
@Override
public PayOutMessage build() {
PayJsonOutMessage message = new PayJsonOutMessage();
setCommon(message);
message.setContent(json.toJSONString());
return message;
}
}