- protected void load(List<String> lines, Format format) {
- this.contacts = Parser.parse(lines, format);
- setDirty();
-
- for (Contact contact : contacts) {
- contact.setParent(this);
+ /**
+ * Return a {@link String} representation of this {@link Card} in the given
+ * {@link Format}.
+ *
+ * @param format
+ * the {@link Format} to use
+ *
+ * @return the {@link String}
+ */
+ public String toString(Format format) {
+ StringBuilder builder = new StringBuilder();
+ for (String line : Parser.toStrings(this, format)) {
+ builder.append(line);
+ builder.append("\r\n");