*
* @param startingBKey
* the starting BKey number (all the other will follow) or -1 for
- * no BKey
+ * no BKey (it is actually not used in this mode)
*
* @return the {@link String} representation
*/
- public static List<String> toStrings(Contact contact, int startingBKey) {
+ public static List<String> toStrings(Contact contact,
+ @SuppressWarnings("unused") int startingBKey) {
// BKey is not used in pine mode
StringBuilder builder = new StringBuilder();
builder.append(notes);
}
+ // abook format = one line per contact
+ String out = builder.toString().replace("\n", "\\n");
+
// note: save as pine means normal LN, nor CRLN
- builder.append('\n');
+ out = out + "\n";
- return Arrays.asList(new String[] { builder.toString() });
+ return Arrays.asList(new String[] { out });
}
/**
int startingBKey) throws IOException {
for (String s : toStrings(contact, startingBKey)) {
writer.append(s);
- writer.append('\n');
}
}
public static void write(Appendable writer, Card card) throws IOException {
for (String s : toStrings(card)) {
writer.append(s);
- writer.append('\n');
}
}
}