@Test public void json() throws Exception { IOTaskResult result = new IOTaskResult(); result.addPoint(new IOTaskResult.Point(IOTaskResult.IOMode.READ, 100L, 20)); result.addPoint(new IOTaskResult.Point(IOTaskResult.IOMode.WRITE, 100L, 5)); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(result); IOTaskResult other = mapper.readValue(json, IOTaskResult.class); checkEquality(result, other); }
public void addPoint(Point p) { mPoints.add(p); }
IOTaskResult implements TaskResult { public void addPoint(Point p) { mPoints.add(p); } }
IOTaskResult implements TaskResult { public void addPoint(Point p) { mPoints.add(p); } IOTaskResult(); @JsonCreator  IOTaskResult(@JsonProperty("points") List<Point> points,
                      @JsonProperty("errors") List<String> errors); }
IOTaskResult implements TaskResult { public void addPoint(Point p) { mPoints.add(p); } IOTaskResult(); @JsonCreator  IOTaskResult(@JsonProperty("points") List<Point> points,
                      @JsonProperty("errors") List<String> errors); void addPoint(Point p); List<Point> getPoints(); void addError(String errorMsg); List<String> getErrors(); void setErrors(List<String> errors); void setPoints(List<Point> points); BaseParameters getBaseParameters(); void setBaseParameters(BaseParameters baseParameters); UfsIOParameters getParameters(); void setParameters(UfsIOParameters parameters); IOTaskResult merge(IOTaskResult anotherResult); static IOTaskResult reduceList(Iterable<IOTaskResult> results); @Override String toString(); @Override TaskResult.Aggregator aggregator(); }
IOTaskResult implements TaskResult { public void addPoint(Point p) { mPoints.add(p); } IOTaskResult(); @JsonCreator  IOTaskResult(@JsonProperty("points") List<Point> points,
                      @JsonProperty("errors") List<String> errors); void addPoint(Point p); List<Point> getPoints(); void addError(String errorMsg); List<String> getErrors(); void setErrors(List<String> errors); void setPoints(List<Point> points); BaseParameters getBaseParameters(); void setBaseParameters(BaseParameters baseParameters); UfsIOParameters getParameters(); void setParameters(UfsIOParameters parameters); IOTaskResult merge(IOTaskResult anotherResult); static IOTaskResult reduceList(Iterable<IOTaskResult> results); @Override String toString(); @Override TaskResult.Aggregator aggregator();  }