Convert JSON To Java Object – Jackson

This article is about how to convert JSON string into Java objects. Here we are using Jackson lib to get Java Object from Json string. Add following maven dependency in your pom.xml file to add support of Jackson library in your project. Perform only two steps to get java object from JSON. 1. Create the […]

Share
Continue reading →

Convert Java Object To JSON – Jackson

This article is base on how to convert java object into JSON string. Here we are using Jackson lib to get JSON from java object. Add following maven dependency in your pom.xml file to add support of Jackson library in your project. Perform only two steps to get JSON from java object. 1. Create the […]

Share
Continue reading →

Useful software for Ubuntu

This article is about useful software you can install in your ubuntu. 1. Unity Tweak Tool : 2. Google Chrome : 3. VLC Player : 4. Clementine Music Player : 5. Skype : 6. Sublime Text : If you are programmer then : 7. Java : Install java 8 ( JDK 8 ) in Ubuntu […]

Share
Continue reading →

About TimeZone in java

This article is about java.util.TimeZone available in java. Programmer are using TimeZone class mainly to convert date and time between different timezone. java.util.TimeZone is a abstract class you can not create it’s object directly using new operator. To get it’s instance you need to use some static methods available in java.util.TimeZone. There are two important […]

Share
Continue reading →

NDC in log4j

org.apache.log4j.NDC NDC (Nested Diagnostic Context) (%x) NDC is implemented using stack, You can push and pop values from it. It is use to print additional values like loginUser along with log message(%m). It contains two static methods NDC.push(String message) and NDC.pop(). You can push multiple values in NDC but make sure that the proper NDC.pop() […]

Share
Continue reading →

MDC in log4j

org.apache.log4j.MDC MDC (Mapped Diagnostic Context) ( %X or %X{mapKey} ) MDC is implemented using Map. Like map you can put and remove values from MDC. MDC is use to print additional values along with log message(%m). It contains two useful static methods MDC.put(String key, Object o) and MDC.remove(String key). You can put multiple values in […]

Share
Continue reading →

Use enum as singleton in java

This article is about how to use Enum for singleton design pattern. Singleton Design Pattern In singleton design pattern only one instance of a class created (allowed or permitted) in entire java application. To create singleton using enum is very easy. Find below code, Created one enum Car. Our Car enum contain two methods getCarName(); […]

Share
Continue reading →