[{"data":1,"prerenderedAt":134},["ShallowReactive",2],{"project-18646202":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":32,"aspects":33,"strip":35,"post_text":29,"what":37,"said":52,"maker_in_thread":79,"shape":84,"grid":85,"attempts":96,"same_week":97,"maker_shows":126,"maker_hidden":127,"reader_version":128,"card":129},"18646202","java-commons","JSON.equals in Java to compare two JSON's","title","Show HN: JSON.equals in Java to compare two JSON's","https:\u002F\u002Ftech.blobcity.com\u002F2018\u002F09\u002F02\u002Fjson-equals-in-java-to-compare-two-jsons\u002F","tech.blobcity.com","sanketsarang",1544430719,2018,6,5,1989,2155,93,"shown","languages","java library","library",[24,25,26,27],"java","json comparison","json equals","json library","quiet",null,{"positive":31,"neutral":32,"mixed":31,"critical":31},0,1,{"performance":34},{"positive":31,"critical":31},[36,31,31,31,31],3,{"problem":38,"audience":29,"pricing":29,"motivation":29,"time_to_build":29,"stack":45,"openness":51,"stage":51,"team_size":51},{"value":39,"source":40,"evidence":41},"Comparing two JSON documents for equality regardless of element order","maker",[42],{"id":43,"by":11,"text":44},"18646246","No string compare does not work, as the order of elements may not be the same so the strings may not be the same. The utility will report both JSON's as equal even if order of…",[46],{"value":47,"source":40,"evidence":48},"Java",[49],{"id":50},"post","unknown",{"praise":53,"objections":54,"requests":61,"questions":62,"alternatives":71},[],[55],{"value":56,"source":40,"evidence":57},"Converting to a Map with toMap() is slow on large JSON",[58],{"id":59,"by":11,"text":60},"18647936","Yes this also works. We were using this for a while until we landed up with very large JSON's. .toMap() is very expensive and takes significantly longer to execute on large JSON's.",[],[63],{"value":64,"source":65,"evidence":66},"Can strings simply be compared for JSON equality","commenter",[67],{"id":68,"by":69,"text":70},"18646226","mscasts","Can't one just simply check if the strings are equal?",[72],{"value":73,"source":65,"evidence":74},"Compare via toMap().equals() on JsonObject",[75],{"id":76,"by":77,"text":78},"18647565","jermo","Thought I'd share something I discovered about Json comparison. This simple line also works: ``` return jsonObject1.toMap().equals(jsonObject2.equals); ``` because JsonObject…",{"comments":80,"answered":32,"key":81},2,[82,83],{"id":59,"text":60},{"id":43,"text":44},{"commenters":36,"max_depth":36,"maker_replies":80,"first_comment_mins":14,"lifespan_hours":14},[86,88,90,92,94],[76,31,36,87,77,31],"project\u002Fneutral\u002Fperformance",[59,31,31,89,11,32],"project\u002Fcritical\u002Fperformance",[68,32,31,91,69,31],"commenter\u002Fneutral\u002Fnone",[43,32,31,93,11,32],"project\u002Fneutral\u002Fidea",[95,32,31,91,69,31],"18646731",[],[98,103,108,113,117,121],{"id":99,"name":100,"points":101,"category":102},"18640880","Visalist",565,"productivity",{"id":104,"name":105,"points":106,"category":107},"18666146","ShaderGif",144,"creative",{"id":109,"name":110,"points":111,"category":112},"18626281","Supportify",141,"consumer_social",{"id":114,"name":115,"points":116,"category":112},"18665475","Strength News",137,{"id":118,"name":119,"points":120,"category":102},"18656746","Egeria",113,{"id":122,"name":123,"points":124,"category":125},"18644560","geogee",112,"games",4,false,"v2",{"id":130,"name":5,"line":6,"ai":127,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":131,"maker":11,"domain":10,"tier":19,"attempts":31,"strip":132,"url":9,"mix":133,"praise":-1,"objection":56,"sub":21},18646202,[24,25,26,27],"30000",[31,32,31,31],1794036572583]