-3

I have a requirement where I have to create java classes for probable JSON response. So basically if I have,

{ email: 'email', password: 'pass' }

I should create a java class like below,

class Credentials
{
    string email;
    string password;

    // getter / setters below...
}

...and then mapping can be done later. That's how it works generally.

What I want is do we have any utility that can automatically create java classes from the JSON response? So if I pass the JSON object data like,

{ email: 'email', password: 'pass' }

I should get a java file automatically created like above. Why I am asking this is because the JSON that I have is pretty complex, objects inside objects inside objects. So I wanted to see if my coding can be reduced by some time if I can get the java file generated directly.

Please let me know if there is anything like this available?

Thanks in advance.

0

1 Answer 1

-3

Use this if you're using Jackson : https://github.com/astav/JsonToJava

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.