添加gson依賴java
Gson gson = new Gson();json
添加GSON 格式化工具工具
到此 Gson格式化工具已經安裝完成this
使用3d
json輸入或者粘貼進輸入框code
點擊右上角的Format 能夠自動格式化orm
點擊okblog
會自動生成以下代碼get
package com.lanyu96.mvpdemo.Demo02; public class material { /** * bosType : 557E499F * propertyType : inventory * material : {"id":"CAQSnI1yS3y7kBAEFYcDG0QJ5/A="} * isControl : false * CU : {"id":"00000000-0000-0000-0000-000000000000CCE7AED4"} * orgUnit : {"id":"CzuVLM5uTZyW//G18vwJ08znrtQ="} * unit : {"id":"gw5fUwEOEADgAAsNwKgSOFuCXFc="} * defaultWarehouse : {"id":"tVXOfvNuRn6cdCtOwsfeurvp+K4="} * qualityOrg : {"id":"zxFY0emRR/2vkvnRna8tPcznrtQ="} * isNegative : false * isBatchNo : true * isLotNumber : true * IsBarcode : true * isSequenceNo : true * IsCompages : true * isPeriodValid : true * isCheck : true * reservationDate : 2 */ private String bosType; private String propertyType; private MaterialBean material; private boolean isControl; private CUBean CU; private OrgUnitBean orgUnit; private UnitBean unit; private DefaultWarehouseBean defaultWarehouse; private QualityOrgBean qualityOrg; private boolean isNegative; private boolean isBatchNo; private boolean isLotNumber; private boolean IsBarcode; private boolean isSequenceNo; private boolean IsCompages; private boolean isPeriodValid; private boolean isCheck; private int reservationDate; public String getBosType() { return bosType; } public void setBosType(String bosType) { this.bosType = bosType; } public String getPropertyType() { return propertyType; } public void setPropertyType(String propertyType) { this.propertyType = propertyType; } public MaterialBean getMaterial() { return material; } public void setMaterial(MaterialBean material) { this.material = material; } public boolean isIsControl() { return isControl; } public void setIsControl(boolean isControl) { this.isControl = isControl; } public CUBean getCU() { return CU; } public void setCU(CUBean CU) { this.CU = CU; } public OrgUnitBean getOrgUnit() { return orgUnit; } public void setOrgUnit(OrgUnitBean orgUnit) { this.orgUnit = orgUnit; } public UnitBean getUnit() { return unit; } public void setUnit(UnitBean unit) { this.unit = unit; } public DefaultWarehouseBean getDefaultWarehouse() { return defaultWarehouse; } public void setDefaultWarehouse(DefaultWarehouseBean defaultWarehouse) { this.defaultWarehouse = defaultWarehouse; } public QualityOrgBean getQualityOrg() { return qualityOrg; } public void setQualityOrg(QualityOrgBean qualityOrg) { this.qualityOrg = qualityOrg; } public boolean isIsNegative() { return isNegative; } public void setIsNegative(boolean isNegative) { this.isNegative = isNegative; } public boolean isIsBatchNo() { return isBatchNo; } public void setIsBatchNo(boolean isBatchNo) { this.isBatchNo = isBatchNo; } public boolean isIsLotNumber() { return isLotNumber; } public void setIsLotNumber(boolean isLotNumber) { this.isLotNumber = isLotNumber; } public boolean isIsBarcode() { return IsBarcode; } public void setIsBarcode(boolean IsBarcode) { this.IsBarcode = IsBarcode; } public boolean isIsSequenceNo() { return isSequenceNo; } public void setIsSequenceNo(boolean isSequenceNo) { this.isSequenceNo = isSequenceNo; } public boolean isIsCompages() { return IsCompages; } public void setIsCompages(boolean IsCompages) { this.IsCompages = IsCompages; } public boolean isIsPeriodValid() { return isPeriodValid; } public void setIsPeriodValid(boolean isPeriodValid) { this.isPeriodValid = isPeriodValid; } public boolean isIsCheck() { return isCheck; } public void setIsCheck(boolean isCheck) { this.isCheck = isCheck; } public int getReservationDate() { return reservationDate; } public void setReservationDate(int reservationDate) { this.reservationDate = reservationDate; } public static class MaterialBean { /** * id : CAQSnI1yS3y7kBAEFYcDG0QJ5/A= */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } public static class CUBean { /** * id : 00000000-0000-0000-0000-000000000000CCE7AED4 */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } public static class OrgUnitBean { /** * id : CzuVLM5uTZyW//G18vwJ08znrtQ= */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } public static class UnitBean { /** * id : gw5fUwEOEADgAAsNwKgSOFuCXFc= */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } public static class DefaultWarehouseBean { /** * id : tVXOfvNuRn6cdCtOwsfeurvp+K4= */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } public static class QualityOrgBean { /** * id : zxFY0emRR/2vkvnRna8tPcznrtQ= */ private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } } }