我有一个包含这些值的字符串:
String verifyPaymentDetails = "{
2298597={mihpayid=403993715508098532, request_id=NULL, bank_ref_num=NULL, amt=53.77, disc=0.00, mode=CC, PG_TYPE=AXIS, card_no=512345XXXXXX2346, name_on_card=emu, udf2=0, addedon=2013-06-03 17:34:42, status=failure, unmappedstatus=failed, Merchant_UTR=NULL, Settled_At=NULL},
6503939={mihpayid=Not Found, status=Not Found}
}"
我想从上面的字符串中提取值并将它们存储如下:
键将是2298597
键的值mihpayid=403993715508098532, request_id=NULL, bank_ref_num=NULL, amt=53.77, disc=0.00, mode=CC, PG_TYPE=AXIS, card_no=512345XXXXXX2346, name_on_card=emu, udf2=0, addedon=2013-06-03 17:34:42, status=failure, unmappedstatus=failed, Merchant_UTR=NULL, Settled_At=NULL
Map<String,Item> tag = new HashMap<String,VerifyPaymentRO>();
这就是我的VerifyPaymentRO
public class VerifyPaymentRO {
private String mihpayid;
private String request_id;
private String bank_ref_num;
private String amt;
private String disc;
private String mode;
private String PG_TYPE;
private String card_no;
private String name_on_card;
private String udf2;
private String addedon;
private String status;
private String unmappedstatus;
private String Merchant_UTR;
private String Settled_At;
public String getMihpayid() {
return mihpayid;
}
public void setMihpayid(String mihpayid) {
this.mihpayid = mihpayid;
}
public String getRequest_id() {
return request_id;
}
public void setRequest_id(String request_id) {
this.request_id = request_id;
}
public String getBank_ref_num() {
return bank_ref_num;
}
public void setBank_ref_num(String bank_ref_num) {
this.bank_ref_num = bank_ref_num;
}
public String getAmt() {
return amt;
}
public void setAmt(String amt) {
this.amt = amt;
}
public String getDisc() {
return disc;
}
public void setDisc(String disc) {
this.disc = disc;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public String getPG_TYPE() {
return PG_TYPE;
}
public void setPG_TYPE(String pG_TYPE) {
PG_TYPE = pG_TYPE;
}
public String getCard_no() {
return card_no;
}
public void setCard_no(String card_no) {
this.card_no = card_no;
}
public String getName_on_card() {
return name_on_card;
}
public void setName_on_card(String name_on_card) {
this.name_on_card = name_on_card;
}
public String getUdf2() {
return udf2;
}
public void setUdf2(String udf2) {
this.udf2 = udf2;
}
public String getAddedon() {
return addedon;
}
public void setAddedon(String addedon) {
this.addedon = addedon;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUnmappedstatus() {
return unmappedstatus;
}
public void setUnmappedstatus(String unmappedstatus) {
this.unmappedstatus = unmappedstatus;
}
public String getMerchant_UTR() {
return Merchant_UTR;
}
public void setMerchant_UTR(String merchant_UTR) {
Merchant_UTR = merchant_UTR;
}
public String getSettled_At() {
return Settled_At;
}
public void setSettled_At(String settled_At) {
Settled_At = settled_At;
}
}
那么如何从字符串中获取 id 和 id 的值并将值复制到 POJO 并将它们像 id 和 object 一样存储在 HashMap 中?
如果春天有办法也可以