could not convert json string to Product class of google client library 1.19.1 -


i receive json string input need convert object of product class. product class belongs google client library 1.19.1.

when converting json string product object, using object mapper, gives following error.

error :

exception in thread "main" java.lang.illegalargumentexception: can not set com.google.api.services.content.model.price field com.google.api.services.content.model.product.price java.util.linkedhashmap

can 1 please suggest, how convert input json string

code same written below :

import org.codehaus.jackson.map.objectmapper;

string temp = "{\"channel\":\"online\",\"contentlanguage\":\"en\",\"offerid\":\"towel\",\"targetcountry\":\"in\",\"condition\":\"refurbished\",\"link\":\"https://www.sokrati.com\",\"price\":{\"value\":\"12\",\"currency\":\"inr\"},\"title\":\"adventures of tintin\",\"availability\":\"preorder\"}";

product product = mapper.readvalue(temp, product.class);


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -