class PublicContentMenuPopulator {

    public PublicContentMenuViewModel populate(CompetitionResource competition, String webBaseUrl) {
        PublicContentResource publicContent = publicContentService.getCompetitionById(competition.getId());
        PublicContentMenuViewModel viewModel = new PublicContentMenuViewModel();
        viewModel.setPublishDate(publicContent.getPublishDate());
        viewModel.setSections(publicContent.getContentSections());
        viewModel.setCompetition(competition);
        viewModel.setInviteOnly(publicContent.getInviteOnly());
        viewModel.setWebBaseUrl(webBaseUrl);
        return viewModel;
    }

}