I have a class A and I wanted to set the value to the object after that convert the same to json string using object mapper .
The problem here is the string that I am setting has to starts with escape char ("\"
) as shown below .
Actual value I wanted to set is "\/Date(1457540067076-0500)\/"
.
Please provide me any guidance or example
A obj = new A();
obj.setTransationDateTime("\/Date(1457540067076-0500)\/"); == Compilation Problem
obj.setTransationDateTime("\\/Date(1457540067076-0500)\\/"); == Json Object is setting value to "\\/Date(1457540067076-0500)\\/" instead of "\/Date(1457540067076-0500)\/"