Code Monkey home page Code Monkey logo

jsonize's Introduction

Jsonize

Simple (but way overly complicated) way aggregate data into a simple one-object JSON response that should have just used methods from the HashMap.java class. Clean your values before adding key value pairs, you don't want to end up with illegal JSON tokens.

  • isObject tells the toString output to append [ and ] to the beginning and end of JSON string.

Usage

You should just be able to throw the JAR file from a tagged release as an included library in the IDE of your choice.

See: https://github.com/LucasChilders/Jsonize/releases

Methods

  • set objects
  • update objects
  • remove objects
  • check if objects exist
  • get value at key
  • get entire map

Bonus: Statically call quick() for a one item response.

Example Use

Jsonize json = new Jsonize(); // Defaults to isObject = false, will not add [ and ] to output.
json.add("message", "There has been an error");
json.add("code", 404);

return json.toString(); // {"message": "There has been an error","code": "404"}

jsonize's People

Contributors

lucaschilders avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.