How to parse a json file into a java POJO class using GSON -
i using gson parse json file , want map json object pojo class. problem property name in json doesn't have camel-case java pojo object having camel-case property name.
is there idea without having performance hit?
eg: attribute name in json file 'ordernumber', in pojo class , instead ordernumber, have 'salesnumber' attribute name. how can map ordernumber json salesnumber of pojo class?
thanks in advance!
you can use @serializedname
annotation in case.
private class someobject { @serializedname("ordernumber") private string salesnumber; }
Comments
Post a Comment