gICS_2.8.6
AssignedModuleDTO.java
1 package org.emau.icmvc.ganimed.ttp.cm2.dto;
2 
3 /*
4  * ###license-information-start###
5  * gICS - a Generic Informed Consent Service
6  * __
7  * Copyright (C) 2014 - 2018 The MOSAIC Project - Institut fuer Community
8  * Medicine of the University Medicine Greifswald -
9  * mosaic-projekt@uni-greifswald.de
10  *
11  * concept and implementation
12  * l.geidel
13  * web client
14  * a.blumentritt, m.bialke
15  *
16  * Selected functionalities of gICS were developed as part of the MAGIC Project (funded by the DFG HO 1937/5-1).
17  *
18  * please cite our publications
19  * http://dx.doi.org/10.3414/ME14-01-0133
20  * http://dx.doi.org/10.1186/s12967-015-0545-6
21  * http://dx.doi.org/10.3205/17gmds146
22  * __
23  * This program is free software: you can redistribute it and/or modify
24  * it under the terms of the GNU Affero General Public License as published by
25  * the Free Software Foundation, either version 3 of the License, or
26  * (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU Affero General Public License
34  * along with this program. If not, see <http://www.gnu.org/licenses/>.
35  * ###license-information-end###
36  */
37 
38 import java.io.Serializable;
39 import java.util.ArrayList;
40 import java.util.List;
41 
43 
50 public class AssignedModuleDTO implements Serializable {
51 
52  private static final long serialVersionUID = 8679417761951775630L;
53  private ModuleDTO module;
54  private boolean mandatory;
55  private ConsentStatus defaultConsentStatus;
56  private List<ConsentStatus> displayCheckboxes = new ArrayList<ConsentStatus>();
57  private int orderNumber;
58  private ModuleKeyDTO parent;
59  private String comment;
60  private String externProperties;
61 
62  public AssignedModuleDTO() {
63  }
64 
65  public AssignedModuleDTO(ModuleDTO module, ModuleKeyDTO parent) {
66  super();
67  this.module = module;
68  this.parent = parent;
69  }
70 
71  public AssignedModuleDTO(ModuleDTO module, boolean mandatory, ConsentStatus defaultConsentStatus, List<ConsentStatus> displayCheckboxes,
72  int orderNumber, ModuleKeyDTO parent, String comment, String externProperties) {
73  super();
74  this.module = module;
75  this.mandatory = mandatory;
76  this.defaultConsentStatus = defaultConsentStatus;
77  if (displayCheckboxes != null) {
78  this.displayCheckboxes = displayCheckboxes;
79  }
80  this.orderNumber = orderNumber;
81  this.parent = parent;
82  this.comment = comment;
83  this.externProperties = externProperties;
84  }
85 
86  public ModuleDTO getModule() {
87  return module;
88  }
89 
90  public void setModule(ModuleDTO module) {
91  this.module = module;
92  }
93 
94  public boolean getMandatory() {
95  return mandatory;
96  }
97 
98  public void setMandatory(boolean mandatory) {
99  this.mandatory = mandatory;
100  }
101 
102  public ConsentStatus getDefaultConsentStatus() {
103  return defaultConsentStatus;
104  }
105 
106  public void setDefaultConsentStatus(ConsentStatus defaultConsentStatus) {
107  this.defaultConsentStatus = defaultConsentStatus;
108  }
109 
110  public List<ConsentStatus> getDisplayCheckboxes() {
111  return displayCheckboxes;
112  }
113 
114  public void setDisplayCheckboxes(List<ConsentStatus> displayCheckboxes) {
115  if (displayCheckboxes != null) {
116  this.displayCheckboxes = displayCheckboxes;
117  }
118  }
119 
120  public int getOrderNumber() {
121  return orderNumber;
122  }
123 
124  public void setOrderNumber(int orderNumber) {
125  this.orderNumber = orderNumber;
126  }
127 
128  public ModuleKeyDTO getParent() {
129  return parent;
130  }
131 
132  public void setParent(ModuleKeyDTO parent) {
133  this.parent = parent;
134  }
135 
136  public String getComment() {
137  return comment;
138  }
139 
140  public void setComment(String comment) {
141  this.comment = comment;
142  }
143 
144  public String getExternProperties() {
145  return externProperties;
146  }
147 
148  public void setExternProperties(String externProperties) {
149  this.externProperties = externProperties;
150  }
151 
152  @Override
153  public int hashCode() {
154  final int prime = 31;
155  int result = 1;
156  result = prime * result + ((comment == null) ? 0 : comment.hashCode());
157  result = prime * result + ((defaultConsentStatus == null) ? 0 : defaultConsentStatus.hashCode());
158  result = prime * result + ((displayCheckboxes == null) ? 0 : displayCheckboxes.hashCode());
159  result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
160  result = prime * result + (mandatory ? 1231 : 1237);
161  result = prime * result + ((module == null) ? 0 : module.hashCode());
162  result = prime * result + orderNumber;
163  result = prime * result + ((parent == null) ? 0 : parent.hashCode());
164  return result;
165  }
166 
167  @Override
168  public boolean equals(Object obj) {
169  if (this == obj)
170  return true;
171  if (obj == null)
172  return false;
173  if (getClass() != obj.getClass())
174  return false;
175  AssignedModuleDTO other = (AssignedModuleDTO) obj;
176  if (comment == null) {
177  if (other.comment != null)
178  return false;
179  } else if (!comment.equals(other.comment))
180  return false;
181  if (defaultConsentStatus != other.defaultConsentStatus)
182  return false;
183  if (displayCheckboxes == null) {
184  if (other.displayCheckboxes != null)
185  return false;
186  } else if (!displayCheckboxes.equals(other.displayCheckboxes))
187  return false;
188  if (externProperties == null) {
189  if (other.externProperties != null)
190  return false;
191  } else if (!externProperties.equals(other.externProperties))
192  return false;
193  if (mandatory != other.mandatory)
194  return false;
195  if (module == null) {
196  if (other.module != null)
197  return false;
198  } else if (!module.equals(other.module))
199  return false;
200  if (orderNumber != other.orderNumber)
201  return false;
202  if (parent == null) {
203  if (other.parent != null)
204  return false;
205  } else if (!parent.equals(other.parent))
206  return false;
207  return true;
208  }
209 
210  @Override
211  public String toString() {
212  StringBuffer sb = new StringBuffer((module == null) ? "MODULE IS NULL" : module.toString());
213  sb.append(", default value: '");
214  sb.append((defaultConsentStatus == null) ? "'null'" : defaultConsentStatus.toString());
215  sb.append("' is mandatory: ");
216  sb.append(mandatory);
217  sb.append(", has order number ");
218  sb.append(orderNumber);
219  sb.append(", as parent: '");
220  sb.append(parent);
221  sb.append("' should show checkboxes for");
222  for (ConsentStatus consentStatus : displayCheckboxes) {
223  sb.append(" ");
224  sb.append(consentStatus.toString());
225  }
226  sb.append("', has as comment '");
227  sb.append(comment);
228  sb.append("' and externProperties '");
229  sb.append(externProperties);
230  return sb.toString();
231  }
232 }
objekt fuer die m-n tabelle consent template <-> modul
wie wurde ein modul (und damit die enthaltenen policies) innerhalb eines consents konsentiert...
ein modul ist eine zustimmbare unterteilung eines consents; sie fasst mehrere policies zusammen...
Definition: ModuleDTO.java:48