Json inheritance Java | Json Inheritance handling using Gson | Gson Tutorial in Hindi | How To Code.

Publicado el: 04 septiembre 2020
en el canal de: HowToCode
1,251
18

Json inheritance Java or Gson Tutorial in Hindi : In this videos we will show you how to handle Json Inheritance in java using Gson in spring boot or any other maven project.

We will have different derived classes from one base class and then we map list of users json array to list of java classes Object.

Maven Dependencies:
https://mvnrepository.com/artifact/co...

In this java json tutorial in Hindi for Json Inheritance handing we have crated a base class as :
User
----------------------------
Stirng firstName
String lastName
Integer age
Address address

Derived classes as:
Admin
--------------------------
String userName
String password

Manager
-------------------
Post post

Json Input as:
[{
"username": "username",
"password": "password",
"userType": "ADMIN",
"firstName": "Rohit",
"lastName": "Kumar",
"age": 30
}, {
"post": "HR",
"userType": "MANAGER",
"firstName": "Rahul",
"lastName": "Kumar",
"age": 30
}
]

And we convert this json into respective class.

RuntimeTypeAdapterFactory: (Create a class with the name and copy and paste the content from below link)
https://github.com/google/gson/blob/m...

Any query and Suggestions are most welcome in comment box. Thanks for Watching.

Please Click the below link to Give your Support to the channel by Subscribing it.
   • Json inheritance Java | Json Inherita...  

#JsonTutorialJava
#JsonInheritance
#HowToCode


En esta página del sitio puede ver el video en línea Json inheritance Java | Json Inheritance handling using Gson | Gson Tutorial in Hindi | How To Code. de Duración hora minuto segunda en buena calidad , que subió el usuario HowToCode 04 septiembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,251 veces y le gustó 18 a los espectadores. Disfruta viendo!