Add basic toString method

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1304462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-03-23 16:19:23 +00:00
parent 43987a7d78
commit 37a261b385
1 changed files with 19 additions and 0 deletions

View File

@ -434,5 +434,24 @@ public class CSVFormat implements Serializable {
return out.toString().trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Delimiter=<").append(delimiter).append('>');
if (isEscaping()) {
sb.append(',');
sb.append("Escape=<").append(escape).append('>');
}
if (isEncapsulating()) {
sb.append(',');
sb.append("Encapsulator=<").append(encapsulator).append('>');
}
if (isCommentingEnabled()) {
sb.append(',');
sb.append("CommentStart=<").append(commentStart).append('>');
}
return sb.toString();
}
}