/** * Creates data transfer object, that represents info about the poll. * * @param poll the poll */ public PollDto(Poll poll) { this.id = poll.getId(); this.totalVotesCount = poll.getTotalVotesCount(); for (PollItem option : poll.getPollItems()) { this.pollOptions.add(new PollOptionDto(option)); } }