Пример #1
0
 private String formatMessage(final Message message, final int id) {
   final StringBuilder buffer = new StringBuilder();
   buffer.append(formatId(id));
   buffer.append(formatUnread(message));
   buffer.append(formatFrom(message));
   buffer.append(message.getBody());
   return buffer.toString();
 }
Пример #2
0
 private void showMessage() {
   final Token idToken = getArguments().get(0);
   final int id = validateId(idToken);
   final Message message = getInbox().get(id);
   println(String.format("Id: %d", id));
   println(String.format("From: %s", message.getFrom().toString()));
   println(String.format("Body: %s", message.getBody()));
   println();
   message.markAsRead();
 }