class CompetitionOverviewPopulator {

    public CompetitionOverviewViewModel populateViewModel(PublicContentItemResource publicContentItemResource, boolean userIsLoggedIn) {
        CompetitionOverviewViewModel viewModel = new CompetitionOverviewViewModel();

        viewModel.setCompetitionOpenDate(publicContentItemResource.getCompetitionOpenDate());
        viewModel.setCompetitionCloseDate(publicContentItemResource.getCompetitionCloseDate());
        viewModel.setRegistrationCloseDate(publicContentItemResource.getRegistrationCloseDate());
        viewModel.setCompetitionTitle(publicContentItemResource.getCompetitionTitle());
        viewModel.setNonIfsUrl(publicContentItemResource.getNonIfsUrl());
        viewModel.setNonIfs(publicContentItemResource.getNonIfs());
        viewModel.setUserIsLoggedIn(userIsLoggedIn);
        viewModel.setCompetitionSetupComplete(publicContentItemResource.getSetupComplete());
        viewModel.setH2020(publicContentItemResource.isH2020());

        if(null != publicContentItemResource.getPublicContentResource()) {
            viewModel.setShortDescription(publicContentItemResource.getPublicContentResource().getShortDescription());
            viewModel.setCompetitionId(publicContentItemResource.getPublicContentResource().getCompetitionId());
        }

        viewModel.setAllSections(getSectionPopulators(publicContentItemResource));

        return viewModel;
    }

}