- Choosed longer and more descriptive field-names for the domain-class
`Message`.
- Choosed short names for the TO-class `MessageTO`, which is serialized as
JSON.
stringBuilder.setLength(0);
stringBuilder.append("The existing message with user=");
- stringBuilder.append(e.getExisting().getUser());
+ stringBuilder.append(e.getExisting().getUsername());
stringBuilder.append(" and id=");
stringBuilder.append(e.getExisting().getId());
stringBuilder.append(" cannot be mutated!");
public class MessageTo
{
private Long id;
- private Long serialNumber;
- private LocalDateTime timestamp;
+ private Long serial;
+ private LocalDateTime time;
private String user;
private String text;
message.getId(),
message.getSerialNumber(),
message.getTimestamp(),
- message.getUser(),
- message.getText());
+ message.getUsername(),
+ message.getMessageText());
}
}
private final Long id;
private final Long serialNumber;
private final LocalDateTime timestamp;
- private final String user;
- private final String text;
+ private final String username;
+ private final String messageText;
}