|
| 1 | +/* |
| 2 | + * ****************************************************************************** |
| 3 | + * * SORMAS® - Surveillance Outbreak Response Management & Analysis System |
| 4 | + * * Copyright © 2016-2020 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) |
| 5 | + * * |
| 6 | + * * This program is free software: you can redistribute it and/or modify |
| 7 | + * * it under the terms of the GNU General Public License as published by |
| 8 | + * * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * * (at your option) any later version. |
| 10 | + * * |
| 11 | + * * This program is distributed in the hope that it will be useful, |
| 12 | + * * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * * GNU General Public License for more details. |
| 15 | + * * |
| 16 | + * * You should have received a copy of the GNU General Public License |
| 17 | + * * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 18 | + * ****************************************************************************** |
| 19 | + */ |
| 20 | + |
| 21 | +package de.symeda.sormas.api.campaign.data; |
| 22 | + |
| 23 | +import de.symeda.sormas.api.EntityDto; |
| 24 | +import de.symeda.sormas.api.campaign.CampaignReferenceDto; |
| 25 | +import de.symeda.sormas.api.campaign.form.CampaignFormReferenceDto; |
| 26 | +import de.symeda.sormas.api.region.CommunityReferenceDto; |
| 27 | +import de.symeda.sormas.api.region.DistrictReferenceDto; |
| 28 | +import de.symeda.sormas.api.region.RegionReferenceDto; |
| 29 | +import de.symeda.sormas.api.utils.DataHelper; |
| 30 | + |
| 31 | +import java.util.List; |
| 32 | + |
| 33 | +public class CampaignFormDataDto extends EntityDto { |
| 34 | + |
| 35 | + private static final long serialVersionUID = -8087195060395038093L; |
| 36 | + |
| 37 | + public static final String I18N_PREFIX = "campaignformdata"; |
| 38 | + |
| 39 | + public static final String CAMPAIGN = "campaign"; |
| 40 | + public static final String REGION = "region"; |
| 41 | + public static final String DISTRICT = "district"; |
| 42 | + public static final String COMMUNITY = "community"; |
| 43 | + |
| 44 | + private List<CampaignFormValue> formValues; |
| 45 | + private CampaignReferenceDto campaign; |
| 46 | + private CampaignFormReferenceDto campaignForm; |
| 47 | + private RegionReferenceDto region; |
| 48 | + private DistrictReferenceDto district; |
| 49 | + private CommunityReferenceDto community; |
| 50 | + |
| 51 | + public static CampaignFormDataDto build( |
| 52 | + CampaignReferenceDto campaign, |
| 53 | + CampaignFormReferenceDto campaignForm, |
| 54 | + RegionReferenceDto region, |
| 55 | + DistrictReferenceDto district, |
| 56 | + CommunityReferenceDto community) { |
| 57 | + CampaignFormDataDto campaignFormData = new CampaignFormDataDto(); |
| 58 | + campaignFormData.setUuid(DataHelper.createUuid()); |
| 59 | + campaignFormData.setCampaign(campaign); |
| 60 | + campaignFormData.setCampaignForm(campaignForm); |
| 61 | + campaignFormData.setRegion(region); |
| 62 | + campaignFormData.setDistrict(district); |
| 63 | + campaignFormData.setCommunity(community); |
| 64 | + return campaignFormData; |
| 65 | + } |
| 66 | + |
| 67 | + public List<CampaignFormValue> getFormValues() { |
| 68 | + return formValues; |
| 69 | + } |
| 70 | + |
| 71 | + public void setFormValues(List<CampaignFormValue> formValues) { |
| 72 | + this.formValues = formValues; |
| 73 | + } |
| 74 | + |
| 75 | + public CampaignFormReferenceDto getCampaignForm() { |
| 76 | + return campaignForm; |
| 77 | + } |
| 78 | + |
| 79 | + public void setCampaignForm(CampaignFormReferenceDto campaignForm) { |
| 80 | + this.campaignForm = campaignForm; |
| 81 | + } |
| 82 | + |
| 83 | + public CampaignReferenceDto getCampaign() { |
| 84 | + return campaign; |
| 85 | + } |
| 86 | + |
| 87 | + public void setCampaign(CampaignReferenceDto campaign) { |
| 88 | + this.campaign = campaign; |
| 89 | + } |
| 90 | + |
| 91 | + public RegionReferenceDto getRegion() { |
| 92 | + return region; |
| 93 | + } |
| 94 | + |
| 95 | + public void setRegion(RegionReferenceDto region) { |
| 96 | + this.region = region; |
| 97 | + } |
| 98 | + |
| 99 | + public DistrictReferenceDto getDistrict() { |
| 100 | + return district; |
| 101 | + } |
| 102 | + |
| 103 | + public void setDistrict(DistrictReferenceDto district) { |
| 104 | + this.district = district; |
| 105 | + } |
| 106 | + |
| 107 | + public CommunityReferenceDto getCommunity() { |
| 108 | + return community; |
| 109 | + } |
| 110 | + |
| 111 | + public void setCommunity(CommunityReferenceDto community) { |
| 112 | + this.community = community; |
| 113 | + } |
| 114 | +} |
0 commit comments