jsonify icon indicating copy to clipboard operation
jsonify copied to clipboard

Convert any Java object to JSON for easier debugging

jsonify

Aren't you tired of using breakpoints and expanding all the properties to see a complete object?

Usage

Turn this:

Person person = new Person();
person.setFullName("César Ferreira");
person.setGender("male");
person.setPassword("yoloswag69");
Contact contact = new Contact(new EmailAddress("[email protected]");
person.setContact(contact, "919191919191"));
person.setLocation(new Location("Lisbon", "Texas"));

into this:

{
  "contact": {
    "emailAddress": {
      "email": "[email protected]"
    },
    "phoneNumber": "919191919191"
  },
  "full_name": "César Ferreira",
  "gender": "male",
  "location": {
    "city": "Lisbon",
    "state": "Texas"
  },
  "password": "yoloswag69"
}

With just this:

JSONify.from(person)

Install

Add the dependency in the form:

dependencies {
  compile 'com.cesarferreira.jsonify:jsonify:+'
}

Contributing

  1. Fork it ( https://github.com/cesarferreira/jsonify/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request