Closed

I need a Java code

We have a JSON object given below.

{"label":"Country","value":"1","children":[{"label":"USA","value":"2","children":[{"label":"AZ","value":"3","children":[{"label":"Tempe","value":"4","children":[{"label":"Cotton","value":"5","children":[{"label":"Lake","value":"6","leaf":true},{"label":"Sweet","value":"7","leaf":true}]},{"label":"Sun","value":"9","leaf":true}]},{"label":"Mesa","value":"11","leaf":true}]},{"label":"LV","value":"13","children":[{"label":"Casino","value":"17","leaf":true},{"label":"Fountain","value":"19","leaf":true}]}]},{"label":"Mexico","value":"21","children":[{"label":"Guad","value":"7","leaf":true},{"label":"Puerto","value":"3","children":[{"label":"Beach","value":"4","leaf":true},{"label":"Sand","value":"5","leaf":true}]}]}]}

Need to iterate in Java in such a way that for the object whose "leaf" attribute is TRUE, we have to take the "id" attribute to check if it's an ODD number or not.

If it is an ODD number then add

"children": [

{

"label": "Fish",

"value": "420"

},

{

"label": "Duck",

"value": "420"

}

]

to that object.

So as per this logic, the JSON will become

{"label":"Country","value":"1","children":[{"label":"USA","value":"2","children":[{"label":"AZ","value":"3","children":[{"label":"Tempe","value":"4","children":[{"label":"Cotton","value":"5","children":[{"label":"Lake","value":"6","leaf":true,"children":[{"label":"Fish","value":"420"},{"label":"Duck","value":"420"}]},{"label":"Sweet","value":"7","leaf":true,"children":[{"label":"","value":""}]}]},{"label":"Sun","value":"9","leaf":true,"children":[{"label":"","value":""}]}]},{"label":"Mesa","value":"11","leaf":true,"children":[{"label":"","value":""}]}]},{"label":"LV","value":"13","children":[{"label":"Casino","value":"17","leaf":true,"children":[{"label":"","value":""}]},{"label":"Fountain","value":"20","leaf":true,"children":[{"label":"Fish","value":"420"},{"label":"Duck","value":"420"}]}]}]},{"label":"Mexico","value":"21","children":[{"label":"Guad","value":"7","leaf":true,"children":[{"label":"","value":""}]},{"label":"Puerto","value":"3","children":[{"label":"Beach","value":"4","leaf":true,"children":[{"label":"Fish","value":"420"},{"label":"Duck","value":"420"}]},{"label":"Sand","value":"5","leaf":true,"children":[{"label":"","value":""}]}]}]}]}

Skills: Java, JSON

About the Employer:
( 0 reviews ) Phoenix, United States

Project ID: #32707656

23 freelancers are bidding on average $30 for this job

it2051229

Hi there, I do Java programming. I went through your requirements and I would like to do this project if given the opportunity. Let me know if you are interested.

$30 USD in 1 day
(1096 Reviews)
7.7
b0b90

Hi I am an expert Java developer with over 4 years of development experience. I can build you this simple app in 3 days. Let's discuss it over chat Regards

$20 USD in 1 day
(72 Reviews)
5.8
maadirajudata

Hi Greetings I can do this for you with java spring application using jackson library , it would rest api i hope Regards

$20 USD in 1 day
(53 Reviews)
5.8
usaravananbe2004

Hi, Hope you are doing well, I went through your requirements, I am pretty much confident that I can complete this task as I am expert in Java, Json and I have done similar kind of projects already and deliver in few h More

$50 USD in 1 day
(25 Reviews)
4.8
vallentinponoma5

Hello? How are you? Thanks for posting this job. I am a Senior Java developer with 8+ years experience in JavaFX and Java Swing. I have been doing this kind of Java projects many times. Please let me know. Best Regards

$50 USD in 1 day
(5 Reviews)
3.7
harfarooqi

Hi I have seen your job description and interested in work of java project. Please provide more details about the work. Best

$25 USD in 7 days
(17 Reviews)
3.6
agrawalad71

Hello, I have worked on JSON objects in Java. I have 4+ years of experience working as a java developer. I can complete this project within given time. Please discuss the details over chat. Thank you.

$20 USD in 1 day
(2 Reviews)
2.7
nlhdung

Hi, I read your description carefully. I have 7+ years experience in Java/.NET/Mobile Android/iOS application development with a lot of applications on Store using Java, C#, C++, Kotlin, Swift, Objective-C. With my ex More

$100 USD in 1 day
(1 Review)
2.4
anilnivargi49

Hi, I have around 8+ yrs of exp. in java/j2ee and mainly worked in java8, Spring boot, Spring MVC, JPA/Hibernate, RDBMS and NoSQL databases. We can discuss more details over the chat.

$25 USD in 7 days
(1 Review)
1.2
usamaosama

Hi, Hope You are fine sir. I can Provide You Solution. Your Satisfaction is my first priority sir. my projects include: [login to view URL] [login to view URL]

$20 USD in 3 days
(0 Reviews)
0.0
davidkinyqrut

Hi esteemed client, Did you know accurate bug free code is not sheer luck but 100% work effort from an experienced developer? I am here to confidently ascertain that I will assist in the fixing the Json object and ap More

$50 USD in 2 days
(0 Reviews)
0.0
Indrajeet1998Pro

I am a java full stack developer. As i have experience in developing java back end codes and working with json data. I can easily complete your requirements. It's fact that it will be my first project on this site. I w More

$20 USD in 5 days
(0 Reviews)
0.0
ShankarKFL

Hello, I am a professional Java developer with 6 years of experience in Java related technologies. I have worked in multiple projects from multiple domains with hands-on experience in Java8 SpringBoot Microservices AWS More

$20 USD in 7 days
(0 Reviews)
0.0
robertgazariants

Hi. I can accept right now and can do this in 2hr. I've read your requirements very carefully and I have a good idea. I have 7+years of great experience in Java Spring Boot, Java Plugin. So more specifically my skills More

$19 USD in 1 day
(0 Reviews)
0.0
zoyaklocheva

hello. I have a lot of experience working with json objects. for convenience, I prefer written communication and only on this site.

$50 USD in 3 days
(0 Reviews)
1.4
atsontakke

Hi, I am Atul Sontakke. I have 2.5 years of experience with Java. I also work on JSON databases. I will finish project as soon as you required. Thank you

$20 USD in 7 days
(0 Reviews)
0.0
tripathishweta58

I have 5+ years of experience in Java and rest API. I have handled JSON object in past.I’m interested to hear more about the project. If you award me the project, I’d be pleased to discuss this further and get started More

$20 USD in 7 days
(0 Reviews)
0.0
gsantharam7088

Hi sir/madam, I am a Spring boot developer, I had done many projects in Spring boot, I know to integrate Spring boot with email and SMS service and also web socket connection, I know to deploy the Spring boot in herok More

$30 USD in 7 days
(0 Reviews)
2.4
Likari

I have a lot of experience with JSON documents. I often worked with test data which is usually present in JSON files.

$20 USD in 1 day
(0 Reviews)
0.0
Boondar

Hello sir, I checked your requirements and I am interested to work with you for this project. I think my experience makes me the right person for this job.

$30 USD in 1 day
(0 Reviews)
0.0