package weaver.dao;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import foundation.data.entity.Entity;
|
import foundation.util.ContentBuilder;
|
|
public class BusinessData{
|
private String dataname;
|
private String id;
|
private String customerName;
|
|
public BusinessData(String dataname, Entity entity) {
|
this.dataname = dataname;
|
this.id = entity.getId();
|
this.customerName = entity.getString("customer_name");
|
}
|
|
public BusinessData(JSONObject jsonObject) {
|
if (jsonObject == null) {
|
return;
|
}
|
this.dataname = jsonObject.getString("dataname");
|
this.id = jsonObject.getString("id");
|
this.customerName = jsonObject.getString("customerName");
|
}
|
|
public String getDataname() {
|
return dataname;
|
}
|
|
public String getId() {
|
return id;
|
}
|
|
public String getCustomerName() {
|
return customerName;
|
}
|
|
public String toString() {
|
ContentBuilder builder = new ContentBuilder(",");
|
|
builder.append("\"dataname\":\"" + dataname + "\"");
|
builder.append("\"id\":\"" + id + "\"");
|
builder.append("\"customerName\":\"" + customerName + "\"");
|
|
return "{" + builder.toString() +"}";
|
}
|
|
|
|
|
}
|