我有一个我设置值的 POJO,pojo 是:
public class CreateRequisitionRO extends AbstractPortfolioSpecificRO {
private static final long serialVersionUID = 2418929142185068821L;
private BigDecimal transSrlNo;
private String transCode;
private InflowOutflow inflowOutflow;
public BigDecimal getTransSrlNo() {
return transSrlNo;
}
public void setTransSrlNo(BigDecimal transSrlNo) {
this.transSrlNo = transSrlNo;
}
public InflowOutflow getInflowOutflow() {
return inflowOutflow;
}
public void setInflowOutflow(InflowOutflow inflowOutflow) {
this.inflowOutflow = inflowOutflow;
}
public String getTransCode() {
return transCode;
}
}
这就是我设置值的方式:
CreateRequisitionRO[] request = new CreateRequisitionRO[1];
request[0].setTransSrlNo(new BigDecimal(1));
request[0].setTransCode("BUY");
request[0].setInflowOutflow(InflowOutflow.I);
now i would like to convert/serialize the above java pojo to Json string.
有人能帮我怎么做吗?
此致