Wednesday, April 4, 2018

How to convert json object to java classes - 01 (Basic Build)


Try to build This.

Json Body

{
  "retriveCusDetailsFrmCrmDTOI": {
         "accountNo": "",
         "apiCallingUser": "QA",
  
         "custref": "",
         "msisdn": "734300066",
         "provideServiceNoDetailsOnly": "2",
         "reqSBU": "7",
         "terminalIP": "",
         "terminalName": ""
  },
  "userId": "shar",
  "appName": "myapp"
}

RetriveCusDetailsFrmCrmDTO class

public class RetriveCusDetailsFrmCrmDTO {

 private RetriveCusDetailsFrmCrmDTOI retriveCusDetailsFrmCrmDTOI;
 private String userId;
 private String appName;
 
 public RetriveCusDetailsFrmCrmDTOI getRetriveCusDetailsFrmCrmDTOI() {
  return retriveCusDetailsFrmCrmDTOI;
 }
 public void setRetriveCusDetailsFrmCrmDTOI(RetriveCusDetailsFrmCrmDTOI retriveCusDetailsFrmCrmDTOI) {
  this.retriveCusDetailsFrmCrmDTOI = retriveCusDetailsFrmCrmDTOI;
 }
 public String getUserId() {
  return userId;
 }
 public void setUserId(String userId) {
  this.userId = userId;
 }
 public String getAppName() {
  return appName;
 }
 public void setAppName(String appName) {
  this.appName = appName;
 }
}



RetriveCusDetailsFrmCrmDTOI class

public class RetriveCusDetailsFrmCrmDTOI {
 
 private String accountNo;
 private String apiCallingUser;
 private String custref;
 private String msisdn;
 private String provideServiceNoDetailsOnly;
 private String reqSBU;
 private String terminalIP;
 private String terminalName;
 
 //Getter And Setter
}


http://localhost:9080/springbootbasic/address/addressList

No comments:

Post a Comment