Sha256: b4d6393d3bb20dbd732a53f3a8da93fbd20b11a4ea6733491037b91dd7e93090
Contents?: true
Size: 951 Bytes
Versions: 16
Compression:
Stored size: 951 Bytes
Contents
package sh.calaba.instrumentationbackend.query; import java.io.IOException; import java.util.ArrayList; import java.util.List; import sh.calaba.org.codehaus.jackson.map.ObjectMapper; public class QueryResult { private List result; public QueryResult(List result) { this.result = result; } public boolean isEmpty() { return result.isEmpty(); } public String asJson() { ObjectMapper mapper = new ObjectMapper(); try { return mapper.writeValueAsString(result); } catch (IOException e) { throw new RuntimeException("Could not convert result to json", e); } } public List getResult() { return result; } public List asList() { List<Object> finalResult = new ArrayList(result.size()); for (Object o : result) { finalResult.add(ViewMapper.mapView(o)); } return finalResult; } }
Version data entries
16 entries across 16 versions & 1 rubygems