首页 > 代码库 > Gson将参数放入实体类中进行包装之后再传递

Gson将参数放入实体类中进行包装之后再传递

 

package com.sinoservices.dms.orderinfo.entity;

public class OrderDetailKeyCondition

{
  //工单主键
  private Long id;

  public Long getId() {
  return id;
  }

  public void setId(Long id) {
  this.id = id;
  }
}

 

Gson gson = new Gson();
if(!"".equals(data) && data !=null)
{

OrderDetailKeyCondition detailKey = gson.fromJson(data, OrderDetailKeyCondition.class);
Long id = detailKey.getId();
//派工单主信息
EtHdDispatchListModel etHdDispatchListModel = etHdDispatchListManager.get(id);

}

Gson将参数放入实体类中进行包装之后再传递