Why deepCopy is not public?
See original GitHub issueIs there a reason why the deepCopy
methods are not public? I see that they were public for some time in an earlier revision then was made “default” access level but I couldn’t find the reason.
Issue Analytics
- State:
- Created 8 years ago
- Comments:27 (1 by maintainers)
Top Results From Across the Web
Gson JsonObject copy value affected others ... - Stack Overflow
deepCopy method is private!, cannot be used out side its scope, you can use Gson to parse the jsonObject to a string and...
Read more >JsonObject (Gson 2.8.2 API) - javadoc.io
A class representing an object type in Json. An object consists of name-value pairs where names are strings, and values are any other...
Read more >How to Make a Deep Copy of an Object in Java - Baeldung
Learn four ways to create a deep copy of an object in Java, and why to prefer a deep copy over a shallow...
Read more >Object Cloning - Manual - PHP
When an object is cloned, PHP will perform a shallow copy of all of the object's properties. Any properties that are references to...
Read more >Deep vs. Shallow copying.
A deep copy means actually creating a new array and copying over the values. public class Ex{ private int[] data; // altered to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Guys please make deepCopy public…
+1 to make the deepCopy public. This feature is naturally expected to be provided by the gson library. There are lot of cases where you just want to take some your JsonObject as a source (or template) for your further manipulations(adding/removing properties, etc) but keeping the original untouched. with deepCopy you don’t need to reinvent a wheel in every of your projects. you simply use it out of the box.