`
package cn.tencent.data.ext.service.handler.common;
import cn.tencent.data.ext.vo.domain;
import com.alibaba.fastjson.JSON;
import java.util.HashMap;
import java.util.Map;
public class test {
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
map.put("domain", "a");
map.put("authCode", "v");
map.put("rt", "c");
map.put("sign", "d");
domain s = new domain();
for (String key : map.keySet()) {
if (key.equals("authCode")) {
s.setAuthCode(map.get(key));
System.out.println("s1" + JSON.toJSONString(s));
}
if (key.equals("domain")) {
s.setDomain(map.get(key));
System.out.println("s2" + JSON.toJSONString(s));
}
}
}
}
`
`
package cn.tencent.data.ext.vo;
public class domain {
private String domain;
private String authCode;
private String rt;
private String sign;
private String source_id;
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getAuthCode() {
return authCode;
}
public void setAuthCode(String authCode) {
this.authCode = authCode;
}
public String getRt() {
return rt;
}
public void setRt(String rt) {
this.rt = rt;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getSource_id() {
return source_id;
}
public void setSource_id(String source_id) {
this.source_id = source_id;
}
}
`
标签:map,domain,实体类,String,authCode,id,转化,public From: https://www.cnblogs.com/codeLearn/p/17384572.html