@Test public void serializeVerbose() throws IOException { ResultSerializer resultSerializer = new ToStringResultSerializer(true); String serialized = resultSerializer.serialize(dummyServer(), dummyQuery(), numericResult()); assertThat(serialized).startsWith("Server("); assertThat(serialized).contains("host=host.example.net"); assertThat(serialized).contains("port=4321"); assertThat(serialized).contains("Query("); assertThat(serialized).contains("objectName=myQuery:key=val"); assertResultString(serialized); }
@Override public String serialize(Server server, Query query, Result result) { if (verbose) { return server.toString() + " " + query.toString() + " " + result.toString(); } return result.toString(); }
ToStringResultSerializer implements ResultSerializer { @Override public String serialize(Server server, Query query, Result result) { if (verbose) { return server.toString() + " " + query.toString() + " " + result.toString(); } return result.toString(); } }
ToStringResultSerializer implements ResultSerializer { @Override public String serialize(Server server, Query query, Result result) { if (verbose) { return server.toString() + " " + query.toString() + " " + result.toString(); } return result.toString(); } ToStringResultSerializer();  ToStringResultSerializer(@JsonProperty("verbose") boolean verbose); }
ToStringResultSerializer implements ResultSerializer { @Override public String serialize(Server server, Query query, Result result) { if (verbose) { return server.toString() + " " + query.toString() + " " + result.toString(); } return result.toString(); } ToStringResultSerializer();  ToStringResultSerializer(@JsonProperty("verbose") boolean verbose); @Override String serialize(Server server, Query query, Result result); }
ToStringResultSerializer implements ResultSerializer { @Override public String serialize(Server server, Query query, Result result) { if (verbose) { return server.toString() + " " + query.toString() + " " + result.toString(); } return result.toString(); } ToStringResultSerializer();  ToStringResultSerializer(@JsonProperty("verbose") boolean verbose); @Override String serialize(Server server, Query query, Result result); static final ToStringResultSerializer DEFAULT; }