use of org.codehaus.jackson.map.type.MapType in project ovirt-engine by oVirt.
the class JsonHelper method jsonToMap.
public static Map<String, Object> jsonToMap(String jsonString) throws IOException {
ObjectMapper mapper = new ObjectMapper();
MapType type = mapper.getTypeFactory().constructMapType(Map.class, String.class, Object.class);
Map<String, Object> data = mapper.readValue(jsonString, type);
return data;
}
use of org.codehaus.jackson.map.type.MapType in project incubator-gobblin by apache.
the class KafkaCheckpoint method deserialize.
public static KafkaCheckpoint deserialize(InputStream inputStream) throws IOException {
TypeFactory typeFactory = _mapper.getTypeFactory();
MapType mapType = typeFactory.constructMapType(HashMap.class, Integer.class, Long.class);
HashMap<Integer, Long> checkpoint = _mapper.readValue(inputStream, mapType);
return new KafkaCheckpoint(checkpoint);
}
Aggregations