org.gs4tr.gcc.restclient.util.MapDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gcc-restclient Show documentation
Show all versions of gcc-restclient Show documentation
GlobalLink Connect Cloud java is a library to connect your system to GlobalLink Connect Cloud REST API.
package org.gs4tr.gcc.restclient.util;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.KeyDeserializer;
public class MapDeserializer extends JsonDeserializer {
@Override
public Object deserialize(JsonParser arg0, DeserializationContext arg1)
throws IOException, JsonProcessingException {
Iterator>> map = arg0.readValueAs(new TypeReference>>(){});
while(map.hasNext()) {
List> m = map.next();
}
System.out.println(arg0.readValuesAs(new TypeReference>(){}));
return null;
}
}