MCPcopy Create free account
hub / github.com/Bit0r/java-util / objectToMap

Method objectToMap

src/main/java/util/ExcelUtils.java:45–52  ·  view source on GitHub ↗

java对象转map @param obj @return

(Object obj)

Source from the content-addressed store, hash-verified

43 * @return
44 */
45 public static Map<?, ?> objectToMap(Object obj) {
46 Map userMap = new HashMap();
47 if (obj != null) {
48 userMap = JSON.parseObject(JSON.toJSONString(obj), new TypeReference<Map<String, String>>() {
49 });
50 }
51 return userMap;
52 }
53
54 /**
55 * java对象转map

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected