-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to String convert Object #72
Comments
Sorry, I can't understand your question. What is the input you have and what is the output you expect? |
Java class: `public class User {
JSON String:
How to JSON String convert Object or ArrayList (ps : List) ? |
new JsonObject()
.add("userId", user.getUserId())
.add("userName", user.getUserName())
.add("password", user.getPassword())
.toString(); |
thanks! Is so simple, If there is such a API would be good. ps: new JsonObject(User user).toString(); or new JsonObject(String jsonStr).toObject(User.class); GSON example Object to JSON String:
JSON String to Object:
|
You are comparing two completely different mechanisms. The idea of this library is to not be an object mapper! minimal-json is a bare-bone library which gives you full control over the serialization.
I think you misunderstand the term "Hard coding". |
yeah~ A few days ago,I attention this class library,i want refer to my framework, because it is so faster and small. o(∩_∩)o |
how to String json convert oo Object (ps: User) ,String json convert Array (ps: List) and oo Object or Array convert String json, please tell me , thanks , i can not find about the code on the api and example.
The text was updated successfully, but these errors were encountered: