@Test public void trivialToStringTest() { ValidationProblem p = new ValidationProblem("foo", 1, 2, ValidationProblem.ProblemType.ERROR); String s = p.toString(); assertThat(s, containsString("line=1")); assertThat(s, containsString("column=2")); assertThat(s, containsString("type=ERROR")); assertThat(s, containsString("message='foo'")); }
@Override public String toString() { final StringBuilder sb = new StringBuilder("ValidationProblem { "); sb.append("line=").append(line); sb.append(", column=").append(column); sb.append(", type=").append(type); sb.append(", message='").append(message).append('\''); sb.append(" }"); return sb.toString(); }
ValidationProblem { @Override public String toString() { final StringBuilder sb = new StringBuilder("ValidationProblem { "); sb.append("line=").append(line); sb.append(", column=").append(column); sb.append(", type=").append(type); sb.append(", message='").append(message).append('\''); sb.append(" }"); return sb.toString(); } }
ValidationProblem { @Override public String toString() { final StringBuilder sb = new StringBuilder("ValidationProblem { "); sb.append("line=").append(line); sb.append(", column=").append(column); sb.append(", type=").append(type); sb.append(", message='").append(message).append('\''); sb.append(" }"); return sb.toString(); } ValidationProblem(String message, int line, int column,
                             ProblemType type); }
ValidationProblem { @Override public String toString() { final StringBuilder sb = new StringBuilder("ValidationProblem { "); sb.append("line=").append(line); sb.append(", column=").append(column); sb.append(", type=").append(type); sb.append(", message='").append(message).append('\''); sb.append(" }"); return sb.toString(); } ValidationProblem(String message, int line, int column,
                             ProblemType type); int getLine(); int getColumn(); ProblemType getType(); String getMessage(); @Override String toString(); }
ValidationProblem { @Override public String toString() { final StringBuilder sb = new StringBuilder("ValidationProblem { "); sb.append("line=").append(line); sb.append(", column=").append(column); sb.append(", type=").append(type); sb.append(", message='").append(message).append('\''); sb.append(" }"); return sb.toString(); } ValidationProblem(String message, int line, int column,
                             ProblemType type); int getLine(); int getColumn(); ProblemType getType(); String getMessage(); @Override String toString(); static final int UNKNOWN; }