Home > Back-end >  Log in the toString class, how to turn it back into the bean instance class object? The debug debugg
Log in the toString class, how to turn it back into the bean instance class object? The debug debugg

Time:05-01

Log in the toString class, how to turn it back into the bean instance class object? The debug debugging with, generally speaking, there are general method, how the prawns are trying?

The object print to log the toString results are as follows:

ShopGoodsBuyerParamDto=shopGoodsBuyerParamDto {shopId=44, goodsCodeList=[20000890, 20000989, 20001017, 20000887, 20000956, 20000879, 20000880, 20001182, 20001186, 20001190, 20001174, 20001178, 20000617]}, buyer=buyer {id=1234, name='Joe', cityId=310100}


General how to put this object to return to the Java bean Entity, general method to realize the entityStringToEntity what?


Classes are defined as follows:
 
Public class ShopGoodsBuyerParamDto {

The Integer shopId;
List GoodsCodeList;
Buyer Buyer;

Public Integer getShopId () {
Return shopId;
}

Public void setShopId (Integer shopId) {
Enclosing shopId=shopId;
}

Public List GetGoodsCodeList () {
Return goodsCodeList;
}

Public void setGoodsCodeList (List GoodsCodeList) {
Enclosing goodsCodeList=goodsCodeList;
}

Public Buyer getBuyer () {
Return buyer;
}

Public void setBuyer Buyer (Buyer) {
This. Buyer=buyer;
}

@ Override
Public String toString () {
Return ShopGoodsBuyerParamDto {" + "
"ShopId=" + shopId +
", goodsCodeList="+ goodsCodeList +
", buyer="+ buyer +
'} ';
}
}


 
Public class Buyer {

The Integer id;
String name;
The Integer cityId;

Public Integer getId () {
Return the id;
}

Public void setId (Integer id) {
this.id=id;
}

Public String getName () {
return name;
}

Public void elegantly-named setName (String name) {
this.name=name;
}

Public Integer getCityId () {
Return cityId;
}

Public void setCityId (Integer cityId) {
Enclosing cityId=cityId;
}

@ Override
Public String toString () {
Return Buyer {" + "
"Id=" + id +
"And name='" + name +' \ ' '+
+ cityId ", cityId="+
'} ';
}
}

CodePudding user response:

Don't understand what you want to ask

CodePudding user response:

The
reference 1/f, hidden in the temple of the reply:
don't understand what you want to ask


Is similar to the serialization and deserialization of the concept,


One of my object. The toString () into a string: shopGoodsBuyerParamDto=shopGoodsBuyerParamDto {shopId=44, goodsCodeList=[20000890, 20000989, 20001017, 20000887, 20000956, 20000879, 20000880, 20001182, 20001186, 20001190, 20001174, 20001178, 20000617]}, buyer=buyer {id=1234, name='Joe', cityId=310100}

Now I want to put the string into object,

CodePudding user response:

When you can be in the toString () in a similar fastjson output standard json, the framework of the back can also use the corresponding method to parse the json string for the object

CodePudding user response:

Solution: no, I have the same demand

CodePudding user response:

Positive solution, 3/f fastjson with Jackson or Gson can be considered
  • Related