GxyJobEntity gxyJobEntity1 = new GxyJobEntity(); gxyJobEntity1.setUserId("user001"); gxyJobEntity1.setPlanId("plan001"); gxyJobEntity1.setStudentId("stu001"); System.out.println(gxyJobEntity1); String str = JSONUtil.toJsonStr(gxyJobEntity1); System.out.println(str); GxyJobEntity studentEntity= JSONUtil.toBean(str,GxyJobEntity.class); System.out.println(studentEntity); System.out.println(gxyJobEntity1.equals(studentEntity));
输出:
GxyJobEntity [jobId=null, studentId=stu001, planId=plan001, userId=user001]
{"studentId":"stu001","planId":"plan001","userId":"user001"}
GxyJobEntity [jobId=null, studentId=stu001, planId=plan001, userId=user001]
false
原文地址:https://www.cnblogs.com/z360519549/p/11540006.html
时间: 2024-10-16 18:58:45